Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions flang-rt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,11 @@ if (UNIX AND CMAKE_SYSTEM_NAME MATCHES "AIX")
add_compile_definitions(_LARGE_FILE_API)
endif ()

# Check whether the compiler can undefine a macro using the "-U" flag.
# Check whether the compiler can undefine a macro using the "-Wp,-U" flag.
# Aternatively, we could use
# CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "GNU"
# but some older versions of CMake don't define it for GCC itself.
check_cxx_compiler_flag("-UTESTFLAG" FLANG_RT_SUPPORTS_UNDEFINE_FLAG)
check_cxx_compiler_flag("-Wp,-UTESTFLAG" FLANG_RT_SUPPORTS_UNDEFINE_FLAG)

# Check whether -fno-lto is supported.
check_cxx_compiler_flag(-fno-lto FLANG_RT_HAS_FNO_LTO_FLAG)
Expand Down
6 changes: 4 additions & 2 deletions flang-rt/cmake/modules/AddFlangRT.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,10 @@ function (add_flangrt_library name)
# 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)
target_compile_options(${tgtname} PUBLIC
"$<$<COMPILE_LANGUAGE:CXX>:-Wp,-U_GLIBCXX_ASSERTIONS>")
target_compile_options(${tgtname} PUBLIC
"$<$<COMPILE_LANGUAGE:CXX>:-Wp,-U_LIBCPP_ENABLE_ASSERTIONS>")
endif ()

# Non-GTest unittests depend on LLVMSupport
Expand Down
Loading