[libcxx-commits] [libcxxabi] 18b575d - [libc++abi] Fixing up LIBCXXABI_ADDITIONAL_COMPILE_FLAGS (#97608)

via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jul 5 07:13:06 PDT 2024


Author: Zibi Sarbinowski
Date: 2024-07-05T10:13:02-04:00
New Revision: 18b575d4aac603b6acd3fa0d639fbc79cd4f0ac3

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

LOG: [libc++abi] Fixing up LIBCXXABI_ADDITIONAL_COMPILE_FLAGS (#97608)

This is the continuation of #96112 which implements proposal from Louis.
Using PRIVATE option on target_compile_options() fixes the issue of
propagating the option into lib++.

Added: 
    

Modified: 
    libcxxabi/src/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/libcxxabi/src/CMakeLists.txt b/libcxxabi/src/CMakeLists.txt
index d6fcd72dcb1bd..c1a7bcb14eb19 100644
--- a/libcxxabi/src/CMakeLists.txt
+++ b/libcxxabi/src/CMakeLists.txt
@@ -182,7 +182,7 @@ set_target_properties(cxxabi_shared_objects
 if (CMAKE_POSITION_INDEPENDENT_CODE OR NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE)
   set_target_properties(cxxabi_shared_objects PROPERTIES POSITION_INDEPENDENT_CODE ON) # must set manually because it's an object library
 endif()
-target_compile_options(cxxabi_shared_objects PUBLIC "${LIBCXXABI_ADDITIONAL_COMPILE_FLAGS}")
+target_compile_options(cxxabi_shared_objects PRIVATE "${LIBCXXABI_ADDITIONAL_COMPILE_FLAGS}")
 
 if (LIBCXXABI_ENABLE_SHARED)
   add_library(cxxabi_shared SHARED)
@@ -262,7 +262,7 @@ set_target_properties(cxxabi_static_objects
     CXX_STANDARD_REQUIRED OFF # TODO: Make this REQUIRED once we don't need to accommodate the LLVM documentation builders using an ancient CMake
     COMPILE_FLAGS "${LIBCXXABI_COMPILE_FLAGS}"
 )
-target_compile_options(cxxabi_static_objects PUBLIC "${LIBCXXABI_ADDITIONAL_COMPILE_FLAGS}")
+target_compile_options(cxxabi_static_objects PRIVATE "${LIBCXXABI_ADDITIONAL_COMPILE_FLAGS}")
 
 if(LIBCXXABI_HERMETIC_STATIC_LIBRARY)
   target_add_compile_flags_if_supported(cxxabi_static_objects PRIVATE -fvisibility=hidden)


        


More information about the libcxx-commits mailing list