diff --git a/compiler-rt/cmake/Modules/CustomLibcxx/CMakeLists.txt b/compiler-rt/cmake/Modules/CustomLibcxx/CMakeLists.txt --- a/compiler-rt/cmake/Modules/CustomLibcxx/CMakeLists.txt +++ b/compiler-rt/cmake/Modules/CustomLibcxx/CMakeLists.txt @@ -2,7 +2,6 @@ project(custom-libcxx C CXX) # Build static libcxxabi. -set(LIBCXXABI_STANDALONE_BUILD 1) set(LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "") set(LIBCXXABI_ENABLE_EXCEPTIONS ON CACHE BOOL "") set(LIBCXXABI_HERMETIC_STATIC_LIBRARY ON CACHE STRING "") @@ -11,7 +10,6 @@ add_subdirectory(${COMPILER_RT_LIBCXXABI_PATH} ${CMAKE_CURRENT_BINARY_DIR}/cxxabi) # Build static libcxx without exceptions. -set(LIBCXX_STANDALONE_BUILD 1) set(LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY OFF CACHE BOOL "") set(LIBCXX_ENABLE_SHARED OFF CACHE BOOL "") set(LIBCXX_ENABLE_EXCEPTIONS OFF CACHE BOOL "") diff --git a/runtimes/CMakeLists.txt b/runtimes/CMakeLists.txt --- a/runtimes/CMakeLists.txt +++ b/runtimes/CMakeLists.txt @@ -82,10 +82,6 @@ # these flags. if (NOT MSVC) set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nostdinc++ -nostdlib++") - - if (LLVM_EXTERNAL_LIBCXX_SOURCE_DIR AND "libcxx" IN_LIST LLVM_ENABLE_RUNTIMES) - set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -isystem ${LLVM_EXTERNAL_LIBCXX_SOURCE_DIR}/include") - endif() endif() # Avoid checking whether the compiler is working. @@ -96,9 +92,6 @@ include(HandleLLVMOptions) include(FindPythonInterp) -# Remove the -nostdlib++ option we've added earlier. -string(REPLACE "-nostdlib++" "" CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") - # Use libtool instead of ar if you are both on an Apple host, and targeting Apple. if(CMAKE_HOST_APPLE AND APPLE) include(UseLibtool) @@ -114,12 +107,10 @@ string(REPLACE "-" "_" canon_name ${projName}) string(TOUPPER ${canon_name} canon_name) - # The subdirectories need to treat this as standalone builds. D57992 tried - # to get rid of this, but the runtimes treat *_STANDALONE_BUILD=OFF as if - # llvm & clang are configured in the same CMake, and setup dependencies - # against their targets. OpenMP has fixed the issue so we don't set the - # variable. - if (NOT ${canon_name} STREQUAL "OPENMP") + # compiler-rt needs to treat this as standalone builds. D57992 tried + # to get rid of it for compiler-rt, but it treats *_STANDALONE_BUILD=OFF + # as if llvm & clang are configured in the same CMake, and setup dependencies + if ("${canon_name}" STREQUAL "COMPILER_RT") set(${canon_name}_STANDALONE_BUILD ON) endif()