From e95cd94f7edf50367d650410b8e534342eb0e5cb Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Mon, 26 Jul 2021 16:36:43 -0400 Subject: [PATCH] [libc++abi/unwind] NFC: Normalize how we set target properties This is a NFC commit to normalize how we set target properties on the various runtime targets. A follow-up patch is going to add new properties, and I wanted that follow-up patch to be cleaner. --- libcxxabi/src/CMakeLists.txt | 51 ++++++++++++++---------------------- libunwind/src/CMakeLists.txt | 40 +++++++++++++++------------- 2 files changed, 41 insertions(+), 50 deletions(-) diff --git a/libcxxabi/src/CMakeLists.txt b/libcxxabi/src/CMakeLists.txt index 49c6b0ad4e46..889d751b2ef7 100644 --- a/libcxxabi/src/CMakeLists.txt +++ b/libcxxabi/src/CMakeLists.txt @@ -181,25 +181,17 @@ if (LIBCXXABI_ENABLE_SHARED) target_link_libraries(cxxabi_shared PUBLIC pstl::ParallelSTL) endif() set_target_properties(cxxabi_shared - PROPERTIES - CXX_EXTENSIONS - OFF - CXX_STANDARD - 20 - CXX_STANDARD_REQUIRED - OFF - COMPILE_FLAGS - "${LIBCXXABI_COMPILE_FLAGS}" - LINK_FLAGS - "${LIBCXXABI_LINK_FLAGS}" - OUTPUT_NAME - "c++abi" - SOVERSION - "1" - VERSION - "${LIBCXXABI_LIBRARY_VERSION}" - DEFINE_SYMBOL - "") + PROPERTIES + CXX_EXTENSIONS OFF + CXX_STANDARD 20 + CXX_STANDARD_REQUIRED OFF + COMPILE_FLAGS "${LIBCXXABI_COMPILE_FLAGS}" + LINK_FLAGS "${LIBCXXABI_LINK_FLAGS}" + OUTPUT_NAME "c++abi" + SOVERSION "1" + VERSION "${LIBCXXABI_LIBRARY_VERSION}" + DEFINE_SYMBOL "" + ) list(APPEND LIBCXXABI_BUILD_TARGETS "cxxabi_shared") if (LIBCXXABI_INSTALL_SHARED_LIBRARY) @@ -244,19 +236,14 @@ if (LIBCXXABI_ENABLE_STATIC) target_link_libraries(cxxabi_static PUBLIC pstl::ParallelSTL) endif() set_target_properties(cxxabi_static - PROPERTIES - CXX_EXTENSIONS - OFF - CXX_STANDARD - 20 - CXX_STANDARD_REQUIRED - OFF - COMPILE_FLAGS - "${LIBCXXABI_COMPILE_FLAGS}" - LINK_FLAGS - "${LIBCXXABI_LINK_FLAGS}" - OUTPUT_NAME - "c++abi") + PROPERTIES + CXX_EXTENSIONS OFF + CXX_STANDARD 20 + CXX_STANDARD_REQUIRED OFF + COMPILE_FLAGS "${LIBCXXABI_COMPILE_FLAGS}" + LINK_FLAGS "${LIBCXXABI_LINK_FLAGS}" + OUTPUT_NAME "c++abi" + ) if(LIBCXXABI_HERMETIC_STATIC_LIBRARY) append_flags_if_supported(CXXABI_STATIC_LIBRARY_FLAGS -fvisibility=hidden) diff --git a/libunwind/src/CMakeLists.txt b/libunwind/src/CMakeLists.txt index 03fd0fa459a0..05d3e59c81fb 100644 --- a/libunwind/src/CMakeLists.txt +++ b/libunwind/src/CMakeLists.txt @@ -130,16 +130,18 @@ if (LIBUNWIND_ENABLE_SHARED) target_compile_options(unwind_shared PRIVATE -fno-rtti) endif() target_link_libraries(unwind_shared PRIVATE ${LIBUNWIND_LIBRARIES}) - set_target_properties(unwind_shared PROPERTIES - CXX_EXTENSIONS OFF - CXX_STANDARD 11 - CXX_STANDARD_REQUIRED ON - COMPILE_FLAGS "${LIBUNWIND_COMPILE_FLAGS}" - LINK_FLAGS "${LIBUNWIND_LINK_FLAGS}" - LINKER_LANGUAGE C - OUTPUT_NAME "unwind" - VERSION "1.0" - SOVERSION "1") + set_target_properties(unwind_shared + PROPERTIES + CXX_EXTENSIONS OFF + CXX_STANDARD 11 + CXX_STANDARD_REQUIRED ON + COMPILE_FLAGS "${LIBUNWIND_COMPILE_FLAGS}" + LINK_FLAGS "${LIBUNWIND_LINK_FLAGS}" + LINKER_LANGUAGE C + OUTPUT_NAME "unwind" + VERSION "1.0" + SOVERSION "1" + ) list(APPEND LIBUNWIND_BUILD_TARGETS "unwind_shared") if (LIBUNWIND_INSTALL_SHARED_LIBRARY) list(APPEND LIBUNWIND_INSTALL_TARGETS "unwind_shared") @@ -155,14 +157,16 @@ if (LIBUNWIND_ENABLE_STATIC) target_compile_options(unwind_static PRIVATE -fno-rtti) endif() target_link_libraries(unwind_static PRIVATE ${LIBUNWIND_LIBRARIES}) - set_target_properties(unwind_static PROPERTIES - CXX_EXTENSIONS OFF - CXX_STANDARD 11 - CXX_STANDARD_REQUIRED ON - COMPILE_FLAGS "${LIBUNWIND_COMPILE_FLAGS}" - LINK_FLAGS "${LIBUNWIND_LINK_FLAGS}" - LINKER_LANGUAGE C - OUTPUT_NAME "unwind") + set_target_properties(unwind_static + PROPERTIES + CXX_EXTENSIONS OFF + CXX_STANDARD 11 + CXX_STANDARD_REQUIRED ON + COMPILE_FLAGS "${LIBUNWIND_COMPILE_FLAGS}" + LINK_FLAGS "${LIBUNWIND_LINK_FLAGS}" + LINKER_LANGUAGE C + OUTPUT_NAME "unwind" + ) if(LIBUNWIND_HIDE_SYMBOLS) append_flags_if_supported(UNWIND_STATIC_LIBRARY_FLAGS -fvisibility=hidden)