Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/llvm/llvm-project.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaowei Wu <haowei@google.com>2022-10-12 22:54:48 +0300
committerHaowei Wu <haowei@google.com>2022-10-12 22:54:48 +0300
commita3539090884c9159893c0b2b4c1dc34f23510707 (patch)
treeef95635833dbbbea10b793c287bf9e6e25aa7345 /libunwind
parent17095dfe361341e491897ea18b544901bb00f5af (diff)
Revert "[runtimes] Always define cxx_shared, cxx_static & other targets"
This reverts commit 79ee0342dbf025bc70f237bdfe9ccb4e10a592ce which breaks the LLVM TSan bots.
Diffstat (limited to 'libunwind')
-rw-r--r--libunwind/src/CMakeLists.txt56
1 files changed, 26 insertions, 30 deletions
diff --git a/libunwind/src/CMakeLists.txt b/libunwind/src/CMakeLists.txt
index c33180360d41..df32e53d69e6 100644
--- a/libunwind/src/CMakeLists.txt
+++ b/libunwind/src/CMakeLists.txt
@@ -135,9 +135,7 @@ set_property(SOURCE ${LIBUNWIND_C_SOURCES}
# ease, but does not rely on C++ at runtime.
set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "")
-#
# Build the shared library.
-#
add_library(unwind_shared_objects OBJECT EXCLUDE_FROM_ALL ${LIBUNWIND_SOURCES} ${LIBUNWIND_HEADERS})
if(CMAKE_C_COMPILER_ID STREQUAL MSVC)
target_compile_options(unwind_shared_objects PRIVATE /GR-)
@@ -156,27 +154,25 @@ if (CMAKE_POSITION_INDEPENDENT_CODE OR NOT DEFINED CMAKE_POSITION_INDEPENDENT_CO
set_target_properties(unwind_shared_objects PROPERTIES POSITION_INDEPENDENT_CODE ON) # must set manually because it's an object library
endif()
-add_library(unwind_shared SHARED $<$<NOT:$<BOOL:LIBUNWIND_ENABLE_SHARED>>:EXCLUDE_FROM_ALL>)
-target_link_libraries(unwind_shared PUBLIC unwind_shared_objects)
-set_target_properties(unwind_shared
- PROPERTIES
- LINK_FLAGS "${LIBUNWIND_LINK_FLAGS}"
- LINKER_LANGUAGE C
- OUTPUT_NAME "${LIBUNWIND_SHARED_OUTPUT_NAME}"
- VERSION "1.0"
- SOVERSION "1"
-)
-
if (LIBUNWIND_ENABLE_SHARED)
+ add_library(unwind_shared SHARED)
+ target_link_libraries(unwind_shared PUBLIC unwind_shared_objects)
+ set_target_properties(unwind_shared
+ PROPERTIES
+ LINK_FLAGS "${LIBUNWIND_LINK_FLAGS}"
+ LINKER_LANGUAGE C
+ OUTPUT_NAME "${LIBUNWIND_SHARED_OUTPUT_NAME}"
+ VERSION "1.0"
+ SOVERSION "1"
+ )
+
list(APPEND LIBUNWIND_BUILD_TARGETS "unwind_shared")
-endif()
-if (LIBUNWIND_INSTALL_SHARED_LIBRARY)
- list(APPEND LIBUNWIND_INSTALL_TARGETS "unwind_shared")
+ if (LIBUNWIND_INSTALL_SHARED_LIBRARY)
+ list(APPEND LIBUNWIND_INSTALL_TARGETS "unwind_shared")
+ endif()
endif()
-#
# Build the static library.
-#
add_library(unwind_static_objects OBJECT EXCLUDE_FROM_ALL ${LIBUNWIND_SOURCES} ${LIBUNWIND_HEADERS})
if(CMAKE_C_COMPILER_ID STREQUAL MSVC)
target_compile_options(unwind_static_objects PRIVATE /GR-)
@@ -198,20 +194,20 @@ if(LIBUNWIND_HIDE_SYMBOLS)
target_compile_definitions(unwind_static_objects PRIVATE _LIBUNWIND_HIDE_SYMBOLS)
endif()
-add_library(unwind_static STATIC $<$<NOT:$<BOOL:LIBUNWIND_ENABLE_STATIC>>:EXCLUDE_FROM_ALL>)
-target_link_libraries(unwind_static PUBLIC unwind_static_objects)
-set_target_properties(unwind_static
- PROPERTIES
- LINK_FLAGS "${LIBUNWIND_LINK_FLAGS}"
- LINKER_LANGUAGE C
- OUTPUT_NAME "${LIBUNWIND_STATIC_OUTPUT_NAME}"
-)
-
if (LIBUNWIND_ENABLE_STATIC)
+ add_library(unwind_static STATIC)
+ target_link_libraries(unwind_static PUBLIC unwind_static_objects)
+ set_target_properties(unwind_static
+ PROPERTIES
+ LINK_FLAGS "${LIBUNWIND_LINK_FLAGS}"
+ LINKER_LANGUAGE C
+ OUTPUT_NAME "${LIBUNWIND_STATIC_OUTPUT_NAME}"
+ )
+
list(APPEND LIBUNWIND_BUILD_TARGETS "unwind_static")
-endif()
-if (LIBUNWIND_INSTALL_STATIC_LIBRARY)
- list(APPEND LIBUNWIND_INSTALL_TARGETS "unwind_static")
+ if (LIBUNWIND_INSTALL_STATIC_LIBRARY)
+ list(APPEND LIBUNWIND_INSTALL_TARGETS "unwind_static")
+ endif()
endif()
# Add a meta-target for both libraries.