Index: compiler-rt/cmake/Modules/CompilerRTCompile.cmake =================================================================== --- compiler-rt/cmake/Modules/CompilerRTCompile.cmake +++ compiler-rt/cmake/Modules/CompilerRTCompile.cmake @@ -131,10 +131,7 @@ " then echo 'e.g. with:'" " echo ' cp -r' $(dirname $(dirname $(xcrun -f clang)))/lib/c++ '${LLVM_BINARY_DIR}/include/'" " fi" - " echo 'This can also be fixed by checking out the libcxx project from llvm.org and installing the headers'" - " echo 'into your build directory:'" - " echo ' cd ${LLVM_MAIN_SRC_DIR}/projects && svn co http://llvm.org/svn/llvm-project/libcxx/trunk libcxx'" - " echo ' cd ${LLVM_BINARY_DIR} && make -C ${LLVM_MAIN_SRC_DIR}/projects/libcxx installheaders HEADER_DIR=${LLVM_BINARY_DIR}/include'" + " echo 'This can also be fixed by adding libcxx to LLVM_ENABLE_PROJECTS and building the cxx-headers target.'" " echo" " false" "fi" Index: compiler-rt/cmake/base-config-ix.cmake =================================================================== --- compiler-rt/cmake/base-config-ix.cmake +++ compiler-rt/cmake/base-config-ix.cmake @@ -101,24 +101,6 @@ endif() if(APPLE) - # On Darwin if /usr/include/c++ doesn't exist, the user probably has Xcode but - # not the command line tools (or is using macOS 10.14 or newer). If this is - # the case, we need to find the OS X sysroot to pass to clang. - if(NOT EXISTS /usr/include/c++) - execute_process(COMMAND xcrun -sdk macosx --show-sdk-path - OUTPUT_VARIABLE OSX_SYSROOT - ERROR_QUIET - OUTPUT_STRIP_TRAILING_WHITESPACE) - if (NOT OSX_SYSROOT OR NOT EXISTS ${OSX_SYSROOT}) - message(WARNING "Detected OSX_SYSROOT ${OSX_SYSROOT} does not exist") - else() - message(STATUS "Found OSX_SYSROOT: ${OSX_SYSROOT}") - set(OSX_SYSROOT_FLAG "-isysroot${OSX_SYSROOT}") - endif() - else() - set(OSX_SYSROOT_FLAG "") - endif() - option(COMPILER_RT_ENABLE_IOS "Enable building for iOS" On) option(COMPILER_RT_ENABLE_WATCHOS "Enable building for watchOS - Experimental" Off) option(COMPILER_RT_ENABLE_TVOS "Enable building for tvOS - Experimental" Off) Index: compiler-rt/cmake/config-ix.cmake =================================================================== --- compiler-rt/cmake/config-ix.cmake +++ compiler-rt/cmake/config-ix.cmake @@ -363,6 +363,14 @@ endif() endif() + # /usr/include/c++ doesn't exist on macOS 10.14 or newer. + # If this is the case, we need to find the OS X sysroot to pass to clang. + if(NOT EXISTS /usr/include/c++) + set(OSX_SYSROOT_FLAG "-isysroot${DARWIN_osx_SYSROOT}") + else() + set(OSX_SYSROOT_FLAG "") + endif() + if(COMPILER_RT_ENABLE_IOS) list(APPEND DARWIN_EMBEDDED_PLATFORMS ios) set(DARWIN_ios_MIN_VER 9.0)