[libcxx-commits] [libcxxabi] e95cd94 - [libc++abi/unwind] NFC: Normalize how we set target properties

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jul 26 13:38:15 PDT 2021


Author: Louis Dionne
Date: 2021-07-26T16:38:05-04:00
New Revision: e95cd94f7edf50367d650410b8e534342eb0e5cb

URL: https://github.com/llvm/llvm-project/commit/e95cd94f7edf50367d650410b8e534342eb0e5cb
DIFF: https://github.com/llvm/llvm-project/commit/e95cd94f7edf50367d650410b8e534342eb0e5cb.diff

LOG: [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.

Added: 
    

Modified: 
    libcxxabi/src/CMakeLists.txt
    libunwind/src/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/libcxxabi/src/CMakeLists.txt b/libcxxabi/src/CMakeLists.txt
index 49c6b0ad4e462..889d751b2ef7d 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 03fd0fa459a0a..05d3e59c81fb8 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)


        


More information about the libcxx-commits mailing list