[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.
This commit is contained in:
Louis Dionne 2021-07-26 16:36:43 -04:00
parent d297211692
commit e95cd94f7e
2 changed files with 41 additions and 50 deletions

View File

@ -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)

View File

@ -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)