File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -20,10 +20,16 @@ if(NOT DEFINED LLVM_STDLIB_HANDLED)
2020 if (LLVM_COMPILER_IS_GCC_COMPATIBLE)
2121 check_cxx_compiler_flag("-stdlib=libc++" CXX_COMPILER_SUPPORTS_STDLIB)
2222 check_linker_flag(CXX "-stdlib=libc++" CXX_LINKER_SUPPORTS_STDLIB)
23- cmake_push_check_state()
23+
24+ # Check whether C++ include files are available
25+ # runtimes/CMakeLists.txt adds -nostdlib++ and -nostdinc++ to
26+ # CMAKE_REQUIRED_FLAGS, which are incompatible with -stdlib=libc++; use
27+ # a fresh CMAKE_REQUIRED_FLAGS environment.
28+ cmake_push_check_state(RESET)
2429 set (CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -stdlib=libc++" )
2530 check_include_files("chrono" CXX_COMPILER_SUPPORTS_STDLIB_CHRONO LANGUAGE CXX)
2631 cmake_pop_check_state()
32+
2733 if (CXX_COMPILER_SUPPORTS_STDLIB AND CXX_LINKER_SUPPORTS_STDLIB AND CXX_COMPILER_SUPPORTS_STDLIB_CHRONO)
2834 append ("-stdlib=libc++"
2935 CMAKE_CXX_FLAGS CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS
You can’t perform that action at this time.
0 commit comments