diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt --- a/compiler-rt/CMakeLists.txt +++ b/compiler-rt/CMakeLists.txt @@ -457,7 +457,7 @@ append_list_if(MINGW -fms-extensions SANITIZER_COMMON_CFLAGS) # Set common link flags. -append_list_if(COMPILER_RT_HAS_NODEFAULTLIBS_FLAG -nodefaultlibs SANITIZER_COMMON_LINK_FLAGS) +append_list_if(C_SUPPORTS_NODEFAULTLIBS_FLAG -nodefaultlibs SANITIZER_COMMON_LINK_FLAGS) append_list_if(COMPILER_RT_HAS_Z_TEXT -Wl,-z,text SANITIZER_COMMON_LINK_FLAGS) if (COMPILER_RT_USE_BUILTINS_LIBRARY) diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake --- a/compiler-rt/cmake/config-ix.cmake +++ b/compiler-rt/cmake/config-ix.cmake @@ -23,8 +23,8 @@ endif() endif() -check_c_compiler_flag(-nodefaultlibs COMPILER_RT_HAS_NODEFAULTLIBS_FLAG) -if (COMPILER_RT_HAS_NODEFAULTLIBS_FLAG) +check_c_compiler_flag(-nodefaultlibs C_SUPPORTS_NODEFAULTLIBS_FLAG) +if (C_SUPPORTS_NODEFAULTLIBS_FLAG) set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nodefaultlibs") if (COMPILER_RT_HAS_LIBC) list(APPEND CMAKE_REQUIRED_LIBRARIES c) diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt --- a/libcxx/CMakeLists.txt +++ b/libcxx/CMakeLists.txt @@ -593,7 +593,7 @@ target_compile_definitions(${target} PRIVATE -D_LIBCPP_DISABLE_NEW_DELETE_DEFINITIONS) endif() - if (LIBCXX_HAS_COMMENT_LIB_PRAGMA) + if (C_SUPPORTS_COMMENT_LIB_PRAGMA) if (LIBCXX_HAS_PTHREAD_LIB) target_compile_definitions(${target} PRIVATE -D_LIBCPP_LINK_PTHREAD_LIB) endif() @@ -774,7 +774,7 @@ # Unfortunately this cannot be used universally because for example g++ supports # only -nodefaultlibs in which case all libraries will be removed and # all libraries but c++ have to be added in manually. - if (LIBCXX_SUPPORTS_NOSTDLIBXX_FLAG) + if (CXX_SUPPORTS_NOSTDLIBXX_FLAG) target_add_link_flags_if_supported(${target} PRIVATE "-nostdlib++") else() target_add_link_flags_if_supported(${target} PRIVATE "-nodefaultlibs") @@ -782,7 +782,7 @@ target_add_link_flags_if_supported(${target} PRIVATE "/nodefaultlib") endif() - if (LIBCXX_SUPPORTS_UNWINDLIB_NONE_FLAG AND LIBCXXABI_USE_LLVM_UNWINDER) + if (CXX_SUPPORTS_UNWINDLIB_EQ_NONE_FLAG AND LIBCXXABI_USE_LLVM_UNWINDER) # If we're linking directly against the libunwind that we're building # in the same invocation, don't try to link in the toolchain's # default libunwind (which may be missing still). diff --git a/libcxx/cmake/Modules/HandleLibcxxFlags.cmake b/libcxx/cmake/Modules/HandleLibcxxFlags.cmake --- a/libcxx/cmake/Modules/HandleLibcxxFlags.cmake +++ b/libcxx/cmake/Modules/HandleLibcxxFlags.cmake @@ -42,7 +42,7 @@ macro(check_flag_supported flag) mangle_name("${flag}" flagname) - check_cxx_compiler_flag("${flag}" "LIBCXX_SUPPORTS_${flagname}_FLAG") + check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG") endmacro() macro(append_flags DEST) @@ -63,8 +63,8 @@ macro(append_flags_if_supported DEST) foreach(flag ${ARGN}) mangle_name("${flag}" flagname) - check_cxx_compiler_flag("${flag}" "LIBCXX_SUPPORTS_${flagname}_FLAG") - append_flags_if(LIBCXX_SUPPORTS_${flagname}_FLAG ${DEST} ${flag}) + check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG") + append_flags_if(CXX_SUPPORTS_${flagname}_FLAG ${DEST} ${flag}) endforeach() endmacro() @@ -127,8 +127,8 @@ macro(add_target_flags_if_supported) foreach(flag ${ARGN}) mangle_name("${flag}" flagname) - check_cxx_compiler_flag("${flag}" "LIBCXX_SUPPORTS_${flagname}_FLAG") - add_target_flags_if(LIBCXX_SUPPORTS_${flagname}_FLAG ${flag}) + check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG") + add_target_flags_if(CXX_SUPPORTS_${flagname}_FLAG ${flag}) endforeach() endmacro() @@ -154,8 +154,8 @@ macro(add_flags_if_supported) foreach(flag ${ARGN}) mangle_name("${flag}" flagname) - check_cxx_compiler_flag("${flag}" "LIBCXX_SUPPORTS_${flagname}_FLAG") - add_flags_if(LIBCXX_SUPPORTS_${flagname}_FLAG ${flag}) + check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG") + add_flags_if(CXX_SUPPORTS_${flagname}_FLAG ${flag}) endforeach() endmacro() @@ -179,8 +179,8 @@ macro(add_compile_flags_if_supported) foreach(flag ${ARGN}) mangle_name("${flag}" flagname) - check_cxx_compiler_flag("${flag}" "LIBCXX_SUPPORTS_${flagname}_FLAG") - add_compile_flags_if(LIBCXX_SUPPORTS_${flagname}_FLAG ${flag}) + check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG") + add_compile_flags_if(CXX_SUPPORTS_${flagname}_FLAG ${flag}) endforeach() endmacro() @@ -204,8 +204,8 @@ macro(add_link_flags_if_supported) foreach(flag ${ARGN}) mangle_name("${flag}" flagname) - check_cxx_compiler_flag("${flag}" "LIBCXX_SUPPORTS_${flagname}_FLAG") - add_link_flags_if(LIBCXX_SUPPORTS_${flagname}_FLAG ${flag}) + check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG") + add_link_flags_if(CXX_SUPPORTS_${flagname}_FLAG ${flag}) endforeach() endmacro() @@ -234,8 +234,8 @@ function(target_add_link_flags_if_supported target visibility) foreach(flag ${ARGN}) mangle_name("${flag}" flagname) - check_cxx_compiler_flag("${flag}" "LIBCXX_SUPPORTS_${flagname}_FLAG") - if (LIBCXX_SUPPORTS_${flagname}_FLAG) + check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG") + if (CXX_SUPPORTS_${flagname}_FLAG) target_link_libraries(${target} ${visibility} ${flag}) endif() endforeach() @@ -246,8 +246,8 @@ function(target_add_compile_flags_if_supported target visibility) foreach(flag ${ARGN}) mangle_name("${flag}" flagname) - check_cxx_compiler_flag("${flag}" "LIBCXX_SUPPORTS_${flagname}_FLAG") - if (LIBCXX_SUPPORTS_${flagname}_FLAG) + check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG") + if (CXX_SUPPORTS_${flagname}_FLAG) target_compile_options(${target} ${visibility} ${flag}) endif() endforeach() diff --git a/libcxx/cmake/config-ix.cmake b/libcxx/cmake/config-ix.cmake --- a/libcxx/cmake/config-ix.cmake +++ b/libcxx/cmake/config-ix.cmake @@ -12,8 +12,8 @@ # libunwind (and the compiler implicit -lunwind wouldn't succeed as the newly # built libunwind isn't installed yet). For those cases, it'd be good to # link with --uwnindlib=none. Check if that option works. -llvm_check_compiler_linker_flag(C "--unwindlib=none" LIBCXX_SUPPORTS_UNWINDLIB_NONE_FLAG) -if (LIBCXX_SUPPORTS_UNWINDLIB_NONE_FLAG) +llvm_check_compiler_linker_flag(C "--unwindlib=none" CXX_SUPPORTS_UNWINDLIB_EQ_NONE_FLAG) +if (CXX_SUPPORTS_UNWINDLIB_EQ_NONE_FLAG) set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} --unwindlib=none") endif() @@ -46,17 +46,17 @@ # required for the link to go through. We remove sanitizers from the # configuration checks to avoid spurious link errors. -check_c_compiler_flag(-nostdlib++ LIBCXX_SUPPORTS_NOSTDLIBXX_FLAG) -if (LIBCXX_SUPPORTS_NOSTDLIBXX_FLAG) +check_cxx_compiler_flag(-nostdlib++ CXX_SUPPORTS_NOSTDLIBXX_FLAG) +if (CXX_SUPPORTS_NOSTDLIBXX_FLAG) set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nostdlib++") else() - check_c_compiler_flag(-nodefaultlibs LIBCXX_SUPPORTS_NODEFAULTLIBS_FLAG) - if (LIBCXX_SUPPORTS_NODEFAULTLIBS_FLAG) + check_c_compiler_flag(-nodefaultlibs C_SUPPORTS_NODEFAULTLIBS_FLAG) + if (C_SUPPORTS_NODEFAULTLIBS_FLAG) set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nodefaultlibs") endif() endif() -if (LIBCXX_SUPPORTS_NOSTDLIBXX_FLAG OR LIBCXX_SUPPORTS_NODEFAULTLIBS_FLAG) +if (CXX_SUPPORTS_NOSTDLIBXX_FLAG OR C_SUPPORTS_NODEFAULTLIBS_FLAG) if (LIBCXX_HAS_C_LIB) list(APPEND CMAKE_REQUIRED_LIBRARIES c) endif () @@ -98,7 +98,7 @@ check_c_source_compiles(" #pragma comment(lib, \"c\") int main() { return 0; } -" LIBCXX_HAS_COMMENT_LIB_PRAGMA) +" C_SUPPORTS_COMMENT_LIB_PRAGMA) cmake_pop_check_state() endif() diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt --- a/libcxxabi/CMakeLists.txt +++ b/libcxxabi/CMakeLists.txt @@ -276,7 +276,7 @@ # Configure compiler. Must happen after setting the target flags. include(config-ix) -if (LIBCXXABI_HAS_NOSTDINCXX_FLAG) +if (CXX_SUPPORTS_NOSTDINCXX_FLAG) list(APPEND LIBCXXABI_COMPILE_FLAGS -nostdinc++) # cmake 3.14 and above remove system include paths that are explicitly # passed on the command line. We build with -nostdinc++ and explicitly add @@ -497,7 +497,7 @@ add_definitions(-DLIBCXXABI_BAREMETAL) endif() -if (LIBCXXABI_HAS_COMMENT_LIB_PRAGMA) +if (C_SUPPORTS_COMMENT_LIB_PRAGMA) if (LIBCXXABI_HAS_PTHREAD_LIB) add_definitions(-D_LIBCXXABI_LINK_PTHREAD_LIB) endif() diff --git a/libcxxabi/cmake/Modules/HandleLibcxxabiFlags.cmake b/libcxxabi/cmake/Modules/HandleLibcxxabiFlags.cmake --- a/libcxxabi/cmake/Modules/HandleLibcxxabiFlags.cmake +++ b/libcxxabi/cmake/Modules/HandleLibcxxabiFlags.cmake @@ -41,7 +41,7 @@ macro(check_flag_supported flag) mangle_name("${flag}" flagname) - check_cxx_compiler_flag("${flag}" "LIBCXXABI_SUPPORTS_${flagname}_FLAG") + check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG") endmacro() macro(append_flags DEST) @@ -62,8 +62,8 @@ macro(append_flags_if_supported DEST) foreach(flag ${ARGN}) mangle_name("${flag}" flagname) - check_cxx_compiler_flag("${flag}" "LIBCXXABI_SUPPORTS_${flagname}_FLAG") - append_flags_if(LIBCXXABI_SUPPORTS_${flagname}_FLAG ${DEST} ${flag}) + check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG") + append_flags_if(CXX_SUPPORTS_${flagname}_FLAG ${DEST} ${flag}) endforeach() endmacro() @@ -129,8 +129,8 @@ macro(add_target_flags_if_supported) foreach(flag ${ARGN}) mangle_name("${flag}" flagname) - check_cxx_compiler_flag("${flag}" "LIBCXXABI_SUPPORTS_${flagname}_FLAG") - add_target_flags_if(LIBCXXABI_SUPPORTS_${flagname}_FLAG ${flag}) + check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG") + add_target_flags_if(CXX_SUPPORTS_${flagname}_FLAG ${flag}) endforeach() endmacro() @@ -156,8 +156,8 @@ macro(add_flags_if_supported) foreach(flag ${ARGN}) mangle_name("${flag}" flagname) - check_cxx_compiler_flag("${flag}" "LIBCXXABI_SUPPORTS_${flagname}_FLAG") - add_flags_if(LIBCXXABI_SUPPORTS_${flagname}_FLAG ${flag}) + check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG") + add_flags_if(CXX_SUPPORTS_${flagname}_FLAG ${flag}) endforeach() endmacro() @@ -181,8 +181,8 @@ macro(add_compile_flags_if_supported) foreach(flag ${ARGN}) mangle_name("${flag}" flagname) - check_cxx_compiler_flag("${flag}" "LIBCXXABI_SUPPORTS_${flagname}_FLAG") - add_compile_flags_if(LIBCXXABI_SUPPORTS_${flagname}_FLAG ${flag}) + check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG") + add_compile_flags_if(CXX_SUPPORTS_${flagname}_FLAG ${flag}) endforeach() endmacro() @@ -191,8 +191,8 @@ macro(add_c_compile_flags_if_supported) foreach(flag ${ARGN}) mangle_name("${flag}" flagname) - check_c_compiler_flag("${flag}" "LIBCXXABI_SUPPORTS_${flagname}_FLAG") - add_compile_flags_if(LIBCXXABI_SUPPORTS_${flagname}_FLAG ${flag}) + check_c_compiler_flag("${flag}" "C_SUPPORTS_${flagname}_FLAG") + add_compile_flags_if(CXX_SUPPORTS_${flagname}_FLAG ${flag}) endforeach() endmacro() @@ -216,8 +216,8 @@ macro(add_link_flags_if_supported) foreach(flag ${ARGN}) mangle_name("${flag}" flagname) - check_cxx_compiler_flag("${flag}" "LIBCXXABI_SUPPORTS_${flagname}_FLAG") - add_link_flags_if(LIBCXXABI_SUPPORTS_${flagname}_FLAG ${flag}) + check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG") + add_link_flags_if(CXX_SUPPORTS_${flagname}_FLAG ${flag}) endforeach() endmacro() diff --git a/libcxxabi/cmake/config-ix.cmake b/libcxxabi/cmake/config-ix.cmake --- a/libcxxabi/cmake/config-ix.cmake +++ b/libcxxabi/cmake/config-ix.cmake @@ -23,17 +23,17 @@ # required for the link to go through. We remove sanitizers from the # configuration checks to avoid spurious link errors. -check_c_compiler_flag(-nostdlib++ LIBCXXABI_SUPPORTS_NOSTDLIBXX_FLAG) -if (LIBCXXABI_SUPPORTS_NOSTDLIBXX_FLAG) +check_cxx_compiler_flag(-nostdlib++ CXX_SUPPORTS_NOSTDLIBXX_FLAG) +if (CXX_SUPPORTS_NOSTDLIBXX_FLAG) set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nostdlib++") else() - check_c_compiler_flag(-nodefaultlibs LIBCXXABI_SUPPORTS_NODEFAULTLIBS_FLAG) - if (LIBCXXABI_SUPPORTS_NODEFAULTLIBS_FLAG) + check_c_compiler_flag(-nodefaultlibs C_SUPPORTS_NODEFAULTLIBS_FLAG) + if (C_SUPPORTS_NODEFAULTLIBS_FLAG) set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nodefaultlibs") endif() endif() -if (LIBCXXABI_SUPPORTS_NOSTDLIBXX_FLAG OR LIBCXXABI_SUPPORTS_NODEFAULTLIBS_FLAG) +if (CXX_SUPPORTS_NOSTDLIBXX_FLAG OR C_SUPPORTS_NODEFAULTLIBS_FLAG) if (LIBCXXABI_HAS_C_LIB) list(APPEND CMAKE_REQUIRED_LIBRARIES c) endif () @@ -78,12 +78,12 @@ check_c_source_compiles(" #pragma comment(lib, \"c\") int main() { return 0; } -" LIBCXXABI_HAS_COMMENT_LIB_PRAGMA) +" C_SUPPORTS_COMMENT_LIB_PRAGMA) cmake_pop_check_state() endif() # Check compiler flags -check_cxx_compiler_flag(-nostdinc++ LIBCXXABI_HAS_NOSTDINCXX_FLAG) +check_cxx_compiler_flag(-nostdinc++ CXX_SUPPORTS_NOSTDINCXX_FLAG) # Check libraries if(FUCHSIA) diff --git a/libcxxabi/src/CMakeLists.txt b/libcxxabi/src/CMakeLists.txt --- a/libcxxabi/src/CMakeLists.txt +++ b/libcxxabi/src/CMakeLists.txt @@ -116,7 +116,7 @@ endif () # Setup flags. -if (LIBCXXABI_SUPPORTS_NOSTDLIBXX_FLAG) +if (CXX_SUPPORTS_NOSTDLIBXX_FLAG) add_link_flags_if_supported(-nostdlib++) else() add_link_flags_if_supported(-nodefaultlibs) diff --git a/libunwind/CMakeLists.txt b/libunwind/CMakeLists.txt --- a/libunwind/CMakeLists.txt +++ b/libunwind/CMakeLists.txt @@ -276,7 +276,7 @@ add_compile_flags_if_supported(-funwind-tables) set(CMAKE_TRY_COMPILE_TARGET_TYPE ${_previous_CMAKE_TRY_COMPILE_TARGET_TYPE}) -if (LIBUNWIND_USES_ARM_EHABI AND NOT LIBUNWIND_SUPPORTS_FUNWIND_TABLES_FLAG) +if (LIBUNWIND_USES_ARM_EHABI AND NOT CXX_SUPPORTS_FUNWIND_TABLES_FLAG) message(SEND_ERROR "The -funwind-tables flag must be supported " "because this target uses ARM Exception Handling ABI") endif() @@ -285,7 +285,7 @@ add_cxx_compile_flags_if_supported(-fno-rtti) # Ensure that we don't depend on C++ standard library. -if (LIBUNWIND_HAS_NOSTDINCXX_FLAG) +if (CXX_SUPPORTS_NOSTDINCXX_FLAG) list(APPEND LIBUNWIND_COMPILE_FLAGS -nostdinc++) # Remove -stdlib flags to prevent them from causing an unused flag warning. string(REPLACE "--stdlib=libc++" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") @@ -354,7 +354,7 @@ add_definitions(-D_LIBUNWIND_HIDE_SYMBOLS) endif() -if (LIBUNWIND_HAS_COMMENT_LIB_PRAGMA) +if (C_SUPPORTS_COMMENT_LIB_PRAGMA) if (LIBUNWIND_HAS_DL_LIB) add_definitions(-D_LIBUNWIND_LINK_DL_LIB) endif() diff --git a/libunwind/cmake/Modules/HandleLibunwindFlags.cmake b/libunwind/cmake/Modules/HandleLibunwindFlags.cmake --- a/libunwind/cmake/Modules/HandleLibunwindFlags.cmake +++ b/libunwind/cmake/Modules/HandleLibunwindFlags.cmake @@ -42,7 +42,7 @@ macro(check_flag_supported flag) mangle_name("${flag}" flagname) - check_cxx_compiler_flag("${flag}" "LIBUNWIND_SUPPORTS_${flagname}_FLAG") + check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG") endmacro() macro(append_flags DEST) @@ -63,8 +63,8 @@ macro(append_flags_if_supported DEST) foreach(flag ${ARGN}) mangle_name("${flag}" flagname) - check_cxx_compiler_flag("${flag}" "LIBUNWIND_SUPPORTS_${flagname}_FLAG") - append_flags_if(LIBUNWIND_SUPPORTS_${flagname}_FLAG ${DEST} ${flag}) + check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG") + append_flags_if(CXX_SUPPORTS_${flagname}_FLAG ${DEST} ${flag}) endforeach() endmacro() @@ -130,8 +130,8 @@ macro(add_target_flags_if_supported) foreach(flag ${ARGN}) mangle_name("${flag}" flagname) - check_cxx_compiler_flag("${flag}" "LIBUNWIND_SUPPORTS_${flagname}_FLAG") - add_target_flags_if(LIBUNWIND_SUPPORTS_${flagname}_FLAG ${flag}) + check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG") + add_target_flags_if(CXX_SUPPORTS_${flagname}_FLAG ${flag}) endforeach() endmacro() @@ -157,8 +157,8 @@ macro(add_flags_if_supported) foreach(flag ${ARGN}) mangle_name("${flag}" flagname) - check_cxx_compiler_flag("${flag}" "LIBUNWIND_SUPPORTS_${flagname}_FLAG") - add_flags_if(LIBUNWIND_SUPPORTS_${flagname}_FLAG ${flag}) + check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG") + add_flags_if(CXX_SUPPORTS_${flagname}_FLAG ${flag}) endforeach() endmacro() @@ -182,8 +182,8 @@ macro(add_compile_flags_if_supported) foreach(flag ${ARGN}) mangle_name("${flag}" flagname) - check_cxx_compiler_flag("${flag}" "LIBUNWIND_SUPPORTS_${flagname}_FLAG") - add_compile_flags_if(LIBUNWIND_SUPPORTS_${flagname}_FLAG ${flag}) + check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG") + add_compile_flags_if(CXX_SUPPORTS_${flagname}_FLAG ${flag}) endforeach() endmacro() @@ -207,8 +207,8 @@ macro(add_c_compile_flags_if_supported) foreach(flag ${ARGN}) mangle_name("${flag}" flagname) - check_c_compiler_flag("${flag}" "LIBUNWIND_SUPPORTS_${flagname}_FLAG") - add_c_flags_if(LIBUNWIND_SUPPORTS_${flagname}_FLAG ${flag}) + check_c_compiler_flag("${flag}" "C_SUPPORTS_${flagname}_FLAG") + add_c_flags_if(C_SUPPORTS_${flagname}_FLAG ${flag}) endforeach() endmacro() @@ -232,8 +232,8 @@ macro(add_cxx_compile_flags_if_supported) foreach(flag ${ARGN}) mangle_name("${flag}" flagname) - check_cxx_compiler_flag("${flag}" "LIBUNWIND_SUPPORTS_${flagname}_FLAG") - add_cxx_flags_if(LIBUNWIND_SUPPORTS_${flagname}_FLAG ${flag}) + check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG") + add_cxx_flags_if(CXX_SUPPORTS_${flagname}_FLAG ${flag}) endforeach() endmacro() @@ -257,8 +257,8 @@ macro(add_link_flags_if_supported) foreach(flag ${ARGN}) mangle_name("${flag}" flagname) - check_cxx_compiler_flag("${flag}" "LIBUNWIND_SUPPORTS_${flagname}_FLAG") - add_link_flags_if(LIBUNWIND_SUPPORTS_${flagname}_FLAG ${flag}) + check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${flagname}_FLAG") + add_link_flags_if(CXX_SUPPORTS_${flagname}_FLAG ${flag}) endforeach() endmacro() diff --git a/libunwind/cmake/config-ix.cmake b/libunwind/cmake/config-ix.cmake --- a/libunwind/cmake/config-ix.cmake +++ b/libunwind/cmake/config-ix.cmake @@ -9,8 +9,8 @@ # The compiler driver may be implicitly trying to link against libunwind, which # might not work if libunwind doesn't exist yet. Try to check if # --unwindlib=none is supported, and use that if possible. -llvm_check_compiler_linker_flag(C "--unwindlib=none" LIBUNWIND_SUPPORTS_UNWINDLIB_NONE_FLAG) -if (LIBUNWIND_SUPPORTS_UNWINDLIB_NONE_FLAG) +llvm_check_compiler_linker_flag(C "--unwindlib=none" CXX_SUPPORTS_UNWINDLIB_EQ_NONE_FLAG) +if (CXX_SUPPORTS_UNWINDLIB_EQ_NONE_FLAG) set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} --unwindlib=none") endif() @@ -34,17 +34,17 @@ # required for the link to go through. We remove sanitizers from the # configuration checks to avoid spurious link errors. -llvm_check_compiler_linker_flag(C "-nostdlib++" LIBUNWIND_SUPPORTS_NOSTDLIBXX_FLAG) -if (LIBUNWIND_SUPPORTS_NOSTDLIBXX_FLAG) +llvm_check_compiler_linker_flag(C "-nostdlib++" CXX_SUPPORTS_NOSTDLIBXX_FLAG) +if (CXX_SUPPORTS_NOSTDLIBXX_FLAG) set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nostdlib++") else() llvm_check_compiler_linker_flag(C "-nodefaultlibs" LIBUNWIND_SUPPORTS_NODEFAULTLIBS_FLAG) - if (LIBUNWIND_SUPPORTS_NODEFAULTLIBS_FLAG) + if (C_SUPPORTS_NODEFAULTLIBS_FLAG) set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nodefaultlibs") endif() endif() -if (LIBUNWIND_SUPPORTS_NOSTDLIBXX_FLAG OR LIBUNWIND_SUPPORTS_NODEFAULTLIBS_FLAG) +if (CXX_SUPPORTS_NOSTDLIBXX_FLAG OR C_SUPPORTS_NODEFAULTLIBS_FLAG) if (LIBUNWIND_HAS_C_LIB) list(APPEND CMAKE_REQUIRED_LIBRARIES c) endif () @@ -89,12 +89,12 @@ check_c_source_compiles(" #pragma comment(lib, \"c\") int main() { return 0; } -" LIBUNWIND_HAS_COMMENT_LIB_PRAGMA) +" C_SUPPORTS_COMMENT_LIB_PRAGMA) cmake_pop_check_state() endif() # Check compiler flags -check_cxx_compiler_flag(-nostdinc++ LIBUNWIND_HAS_NOSTDINCXX_FLAG) +check_cxx_compiler_flag(-nostdinc++ CXX_SUPPORTS_NOSTDINCXX_FLAG) # Check symbols check_symbol_exists(__arm__ "" LIBUNWIND_TARGET_ARM) diff --git a/libunwind/src/CMakeLists.txt b/libunwind/src/CMakeLists.txt --- a/libunwind/src/CMakeLists.txt +++ b/libunwind/src/CMakeLists.txt @@ -93,8 +93,8 @@ endif() # Setup flags. -add_link_flags_if(LIBUNWIND_SUPPORTS_UNWINDLIB_NONE_FLAG --unwindlib=none) -if (LIBUNWIND_SUPPORTS_NOSTDLIBXX_FLAG) +add_link_flags_if(CXX_SUPPORTS_UNWINDLIB_EQ_NONE_FLAG --unwindlib=none) +if (CXX_SUPPORTS_NOSTDLIBXX_FLAG) add_link_flags_if_supported(-nostdlib++) else() add_link_flags_if_supported(-nodefaultlibs) @@ -104,8 +104,8 @@ add_library_flags_if(MINGW "${MINGW_LIBRARIES}") if (LIBUNWIND_ENABLE_SHARED AND - NOT (LIBUNWIND_SUPPORTS_FNO_EXCEPTIONS_FLAG AND - LIBUNWIND_SUPPORTS_FUNWIND_TABLES_FLAG)) + NOT (CXX_SUPPORTS_FNO_EXCEPTIONS_FLAG AND + CXX_SUPPORTS_FUNWIND_TABLES_FLAG)) message(FATAL_ERROR "Compiler doesn't support generation of unwind tables if exception " "support is disabled. Building libunwind DSO with runtime dependency " diff --git a/runtimes/CMakeLists.txt b/runtimes/CMakeLists.txt --- a/runtimes/CMakeLists.txt +++ b/runtimes/CMakeLists.txt @@ -110,12 +110,12 @@ # 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). -llvm_check_compiler_linker_flag(C "-nostdlib++" LLVM_RUNTIMES_SUPPORT_NOSTDLIBXX_FLAG) -if (LLVM_RUNTIMES_SUPPORT_NOSTDLIBXX_FLAG) +llvm_check_compiler_linker_flag(C "-nostdlib++" CXX_SUPPORTS_NOSTDLIBXX_FLAG) +if (CXX_SUPPORTS_NOSTDLIBXX_FLAG) set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nostdlib++") endif() -check_cxx_compiler_flag(-nostdinc++ LLVM_RUNTIMES_SUPPORT_NOSTDINCXX_FLAG) -if (LLVM_RUNTIMES_SUPPORT_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()