summaryrefslogtreecommitdiff
path: root/runtimes
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@google.com>2024-10-24 23:12:32 -0700
committerGitHub <noreply@github.com>2024-10-25 09:12:32 +0300
commit240e4780680f0d6a760be1b9ea432f410424b3a5 (patch)
tree233d4903978628985c990b4aa5150e8b6315c7f6 /runtimes
parentd0c81509ffe7297903371111e7ee1f6f910c3dac (diff)
Revert "[runtimes] Probe for -nostdlib++ and -nostdinc++ with the C compiler" (#113653)
Reverts llvm/llvm-project#108357 Breaks https://lab.llvm.org/buildbot/#/builders/164/builds/3908 and similar bots
Diffstat (limited to 'runtimes')
-rw-r--r--runtimes/CMakeLists.txt12
1 files changed, 4 insertions, 8 deletions
diff --git a/runtimes/CMakeLists.txt b/runtimes/CMakeLists.txt
index 250ae77fa57b..67368dcedb3b 100644
--- a/runtimes/CMakeLists.txt
+++ b/runtimes/CMakeLists.txt
@@ -143,16 +143,12 @@ endif()
# Check for -nostdlib++ first; if there's no C++ standard library yet,
# all check_cxx_compiler_flag commands will fail until we add -nostdlib++
# (or -nodefaultlibs).
-#
-# Adding flags to CMAKE_REQUIRED_FLAGS will include the flags both when testing
-# compilation of C and C++. Therefore test to make sure that the flags are
-# supported by the C compiler driver, before deciding to include them.
-llvm_check_compiler_linker_flag(C "-nostdlib++" C_SUPPORTS_NOSTDLIBXX_FLAG)
-if (C_SUPPORTS_NOSTDLIBXX_FLAG)
+llvm_check_compiler_linker_flag(CXX "-nostdlib++" CXX_SUPPORTS_NOSTDLIBXX_FLAG)
+if (CXX_SUPPORTS_NOSTDLIBXX_FLAG)
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nostdlib++")
endif()
-check_c_compiler_flag(-nostdinc++ C_SUPPORTS_NOSTDINCXX_FLAG)
-if (C_SUPPORTS_NOSTDINCXX_FLAG)
+check_cxx_compiler_flag(-nostdinc++ CXX_SUPPORTS_NOSTDINCXX_FLAG)
+if (CXX_SUPPORTS_NOSTDINCXX_FLAG)
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nostdinc++")
endif()