diff --git a/flang-rt/cmake/modules/AddFlangRT.cmake b/flang-rt/cmake/modules/AddFlangRT.cmake index 58541609829c4..66e54bd2103a3 100644 --- a/flang-rt/cmake/modules/AddFlangRT.cmake +++ b/flang-rt/cmake/modules/AddFlangRT.cmake @@ -281,6 +281,7 @@ function (add_flangrt_library name) # Disable libstdc++/libc++ assertions, even in an LLVM_ENABLE_ASSERTIONS # build, to avoid an unwanted dependency on libstdc++/libc++.so. + target_compile_definitions(${tgtname} PUBLIC _GLIBCXX_NO_ASSERTIONS) if (FLANG_RT_SUPPORTS_UNDEFINE_FLAG) target_compile_options(${tgtname} PUBLIC -U_GLIBCXX_ASSERTIONS) target_compile_options(${tgtname} PUBLIC -U_LIBCPP_ENABLE_ASSERTIONS) diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt index 08e1753b93636..b22d03d168419 100644 --- a/openmp/runtime/src/CMakeLists.txt +++ b/openmp/runtime/src/CMakeLists.txt @@ -167,6 +167,7 @@ endif() # Disable libstdc++ assertions, even in an LLVM_ENABLE_ASSERTIONS build, to # avoid an unwanted dependency on libstdc++.so. +add_compile_definitions(_GLIBCXX_NO_ASSERTIONS) if(NOT WIN32) add_definitions(-U_GLIBCXX_ASSERTIONS) endif()