[libc++abi] Remove the LIBCXXABI_ENABLE_PIC option
Instead, people should be using CMAKE_POSITION_INDEPENDENT_CODE to control
whether they want to use PIC or not. We should try to avoid reinventing
the wheel whenever CMake natively supports something.
This makes libc++abi consistent with libc++ and libunwind.
Differential Revision: https://reviews.llvm.org/D103973
GitOrigin-RevId: a0ae3b0789140ee9238c3052b2231ceaa777e82f
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1e8b73a..9bd8107 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -82,7 +82,6 @@
When disabled, libc++abi does not support stack unwinding and other exceptions-related features." ON)
option(LIBCXXABI_ENABLE_ASSERTIONS "Enable assertions independent of build mode." ON)
option(LIBCXXABI_ENABLE_PEDANTIC "Compile with pedantic enabled." ON)
-option(LIBCXXABI_ENABLE_PIC "Build Position-Independent Code, even in static library" ON)
option(LIBCXXABI_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF)
option(LIBCXXABI_USE_LLVM_UNWINDER "Build and use the LLVM unwinder." OFF)
option(LIBCXXABI_ENABLE_STATIC_UNWINDER "Statically link the LLVM unwinder." OFF)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index fbf9a10..49c6b0a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -201,10 +201,6 @@
DEFINE_SYMBOL
"")
- if(LIBCXXABI_ENABLE_PIC)
- set_target_properties(cxxabi_shared PROPERTIES POSITION_INDEPENDENT_CODE ON)
- endif()
-
list(APPEND LIBCXXABI_BUILD_TARGETS "cxxabi_shared")
if (LIBCXXABI_INSTALL_SHARED_LIBRARY)
list(APPEND LIBCXXABI_INSTALL_TARGETS "cxxabi_shared")
@@ -262,10 +258,6 @@
OUTPUT_NAME
"c++abi")
- if(LIBCXXABI_ENABLE_PIC)
- set_target_properties(cxxabi_static PROPERTIES POSITION_INDEPENDENT_CODE ON)
- endif()
-
if(LIBCXXABI_HERMETIC_STATIC_LIBRARY)
append_flags_if_supported(CXXABI_STATIC_LIBRARY_FLAGS -fvisibility=hidden)
# If the hermetic library doesn't define the operator new/delete functions