aboutsummaryrefslogtreecommitdiff
path: root/libunwind
diff options
context:
space:
mode:
authormgrzywac <maciej.grzywacz@intel.com>2023-06-29 07:41:08 +0000
committermgrzywac <maciej.grzywacz@intel.com>2023-06-29 07:41:08 +0000
commit9e37142dc12a7d57a793db56ea5fd259171fe20a (patch)
tree7d2851f92a0ce17ac1fd07c3948d638b026ec0c9 /libunwind
parent1c676e08d0ac4626b6347d01c4e110a85c97f9d2 (diff)
downloadllvm-9e37142dc12a7d57a793db56ea5fd259171fe20a.zip
llvm-9e37142dc12a7d57a793db56ea5fd259171fe20a.tar.gz
llvm-9e37142dc12a7d57a793db56ea5fd259171fe20a.tar.bz2
[libunwind] Add cached compile and link flags to libunwind
Add flags allowing to use compile flags and libraries provided in cache with libunwind. Similar flags are already present in libc++ and libc++abi CMakeLists files. Differential Revision: https://reviews.llvm.org/D150252
Diffstat (limited to 'libunwind')
-rw-r--r--libunwind/CMakeLists.txt4
-rw-r--r--libunwind/src/CMakeLists.txt4
2 files changed, 8 insertions, 0 deletions
diff --git a/libunwind/CMakeLists.txt b/libunwind/CMakeLists.txt
index bd49dfb..bc2a820 100644
--- a/libunwind/CMakeLists.txt
+++ b/libunwind/CMakeLists.txt
@@ -143,6 +143,10 @@ set(LIBUNWIND_C_FLAGS "")
set(LIBUNWIND_CXX_FLAGS "")
set(LIBUNWIND_COMPILE_FLAGS "")
set(LIBUNWIND_LINK_FLAGS "")
+set(LIBUNWIND_ADDITIONAL_COMPILE_FLAGS "" CACHE STRING
+ "Additional Compile only flags which can be provided in cache")
+set(LIBUNWIND_ADDITIONAL_LIBRARIES "" CACHE STRING
+ "Additional libraries libunwind is linked to which can be provided in cache")
# Include macros for adding and removing libunwind flags.
include(HandleLibunwindFlags)
diff --git a/libunwind/src/CMakeLists.txt b/libunwind/src/CMakeLists.txt
index 6a9572f..e5897fe 100644
--- a/libunwind/src/CMakeLists.txt
+++ b/libunwind/src/CMakeLists.txt
@@ -132,6 +132,8 @@ else()
target_compile_options(unwind_shared_objects PRIVATE -fno-rtti)
endif()
target_link_libraries(unwind_shared_objects PRIVATE unwind-headers ${LIBUNWIND_LIBRARIES})
+target_compile_options(unwind_shared_objects PUBLIC "${LIBUNWIND_ADDITIONAL_COMPILE_FLAGS}")
+target_link_libraries(unwind_shared_objects PUBLIC "${LIBUNWIND_ADDITIONAL_LIBRARIES}")
set_target_properties(unwind_shared_objects
PROPERTIES
CXX_EXTENSIONS OFF
@@ -170,6 +172,8 @@ else()
target_compile_options(unwind_static_objects PRIVATE -fno-rtti)
endif()
target_link_libraries(unwind_static_objects PRIVATE unwind-headers ${LIBUNWIND_LIBRARIES})
+target_compile_options(unwind_static_objects PUBLIC "${LIBUNWIND_ADDITIONAL_COMPILE_FLAGS}")
+target_link_libraries(unwind_static_objects PUBLIC "${LIBUNWIND_ADDITIONAL_LIBRARIES}")
set_target_properties(unwind_static_objects
PROPERTIES
CXX_EXTENSIONS OFF