xref: /aosp_15_r20/external/libcxxabi/src/CMakeLists.txt (revision c05d8e5dc3e10f6ce4317e8bc22cc4a25f55fa94)
1*c05d8e5dSAndroid Build Coastguard Worker# Get sources
2*c05d8e5dSAndroid Build Coastguard Workerset(LIBCXXABI_SOURCES
3*c05d8e5dSAndroid Build Coastguard Worker  # C++ABI files
4*c05d8e5dSAndroid Build Coastguard Worker  cxa_aux_runtime.cpp
5*c05d8e5dSAndroid Build Coastguard Worker  cxa_default_handlers.cpp
6*c05d8e5dSAndroid Build Coastguard Worker  cxa_demangle.cpp
7*c05d8e5dSAndroid Build Coastguard Worker  cxa_exception_storage.cpp
8*c05d8e5dSAndroid Build Coastguard Worker  cxa_guard.cpp
9*c05d8e5dSAndroid Build Coastguard Worker  cxa_handlers.cpp
10*c05d8e5dSAndroid Build Coastguard Worker  cxa_unexpected.cpp
11*c05d8e5dSAndroid Build Coastguard Worker  cxa_vector.cpp
12*c05d8e5dSAndroid Build Coastguard Worker  cxa_virtual.cpp
13*c05d8e5dSAndroid Build Coastguard Worker  # C++ STL files
14*c05d8e5dSAndroid Build Coastguard Worker  stdlib_exception.cpp
15*c05d8e5dSAndroid Build Coastguard Worker  stdlib_stdexcept.cpp
16*c05d8e5dSAndroid Build Coastguard Worker  stdlib_typeinfo.cpp
17*c05d8e5dSAndroid Build Coastguard Worker  # Internal files
18*c05d8e5dSAndroid Build Coastguard Worker  abort_message.cpp
19*c05d8e5dSAndroid Build Coastguard Worker  fallback_malloc.cpp
20*c05d8e5dSAndroid Build Coastguard Worker  private_typeinfo.cpp
21*c05d8e5dSAndroid Build Coastguard Worker)
22*c05d8e5dSAndroid Build Coastguard Worker
23*c05d8e5dSAndroid Build Coastguard Workerif (LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS)
24*c05d8e5dSAndroid Build Coastguard Worker  list(APPEND LIBCXXABI_SOURCES stdlib_new_delete.cpp)
25*c05d8e5dSAndroid Build Coastguard Workerendif()
26*c05d8e5dSAndroid Build Coastguard Worker
27*c05d8e5dSAndroid Build Coastguard Workerif (LIBCXXABI_ENABLE_EXCEPTIONS)
28*c05d8e5dSAndroid Build Coastguard Worker  list(APPEND LIBCXXABI_SOURCES cxa_exception.cpp)
29*c05d8e5dSAndroid Build Coastguard Worker  list(APPEND LIBCXXABI_SOURCES cxa_personality.cpp)
30*c05d8e5dSAndroid Build Coastguard Workerelse()
31*c05d8e5dSAndroid Build Coastguard Worker  list(APPEND LIBCXXABI_SOURCES cxa_noexception.cpp)
32*c05d8e5dSAndroid Build Coastguard Workerendif()
33*c05d8e5dSAndroid Build Coastguard Worker
34*c05d8e5dSAndroid Build Coastguard Workerif (LIBCXXABI_ENABLE_THREADS AND (UNIX OR FUCHSIA) AND NOT (APPLE OR CYGWIN))
35*c05d8e5dSAndroid Build Coastguard Worker  list(APPEND LIBCXXABI_SOURCES cxa_thread_atexit.cpp)
36*c05d8e5dSAndroid Build Coastguard Workerendif()
37*c05d8e5dSAndroid Build Coastguard Worker
38*c05d8e5dSAndroid Build Coastguard Workerset(LIBCXXABI_HEADERS ../include/cxxabi.h)
39*c05d8e5dSAndroid Build Coastguard Worker
40*c05d8e5dSAndroid Build Coastguard Worker# Add all the headers to the project for IDEs.
41*c05d8e5dSAndroid Build Coastguard Workerif (MSVC_IDE OR XCODE)
42*c05d8e5dSAndroid Build Coastguard Worker  # Force them all into the headers dir on MSVC, otherwise they end up at
43*c05d8e5dSAndroid Build Coastguard Worker  # project scope because they don't have extensions.
44*c05d8e5dSAndroid Build Coastguard Worker  if (MSVC_IDE)
45*c05d8e5dSAndroid Build Coastguard Worker    source_group("Header Files" FILES ${LIBCXXABI_HEADERS})
46*c05d8e5dSAndroid Build Coastguard Worker  endif()
47*c05d8e5dSAndroid Build Coastguard Workerendif()
48*c05d8e5dSAndroid Build Coastguard Worker
49*c05d8e5dSAndroid Build Coastguard Workerinclude_directories("${LIBCXXABI_LIBCXX_INCLUDES}")
50*c05d8e5dSAndroid Build Coastguard Worker
51*c05d8e5dSAndroid Build Coastguard Workerif (LIBCXXABI_HAS_CXA_THREAD_ATEXIT_IMPL)
52*c05d8e5dSAndroid Build Coastguard Worker  add_definitions(-DHAVE___CXA_THREAD_ATEXIT_IMPL)
53*c05d8e5dSAndroid Build Coastguard Workerendif()
54*c05d8e5dSAndroid Build Coastguard Worker
55*c05d8e5dSAndroid Build Coastguard Workerif (LIBCXXABI_ENABLE_THREADS)
56*c05d8e5dSAndroid Build Coastguard Worker  add_library_flags_if(LIBCXXABI_HAS_PTHREAD_LIB pthread)
57*c05d8e5dSAndroid Build Coastguard Workerendif()
58*c05d8e5dSAndroid Build Coastguard Worker
59*c05d8e5dSAndroid Build Coastguard Workeradd_library_flags_if(LIBCXXABI_HAS_C_LIB c)
60*c05d8e5dSAndroid Build Coastguard Workerif (LIBCXXABI_USE_LLVM_UNWINDER)
61*c05d8e5dSAndroid Build Coastguard Worker  # Prefer using the in-tree version of libunwind, either shared or static. If
62*c05d8e5dSAndroid Build Coastguard Worker  # none are found fall back to using -lunwind.
63*c05d8e5dSAndroid Build Coastguard Worker  # FIXME: Is it correct to prefer the static version of libunwind?
64*c05d8e5dSAndroid Build Coastguard Worker  if (NOT LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_SHARED_LIBRARY AND (TARGET unwind_shared OR HAVE_LIBUNWIND))
65*c05d8e5dSAndroid Build Coastguard Worker    list(APPEND LIBCXXABI_SHARED_LIBRARIES unwind_shared)
66*c05d8e5dSAndroid Build Coastguard Worker  elseif (LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_SHARED_LIBRARY AND (TARGET unwind_static OR HAVE_LIBUNWIND))
67*c05d8e5dSAndroid Build Coastguard Worker    list(APPEND LIBCXXABI_SHARED_LIBRARIES unwind_static)
68*c05d8e5dSAndroid Build Coastguard Worker  else()
69*c05d8e5dSAndroid Build Coastguard Worker    list(APPEND LIBCXXABI_SHARED_LIBRARIES unwind)
70*c05d8e5dSAndroid Build Coastguard Worker  endif()
71*c05d8e5dSAndroid Build Coastguard Worker  if (NOT LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_STATIC_LIBRARY AND (TARGET unwind_shared OR HAVE_LIBUNWIND))
72*c05d8e5dSAndroid Build Coastguard Worker    list(APPEND LIBCXXABI_STATIC_LIBRARIES unwind_shared)
73*c05d8e5dSAndroid Build Coastguard Worker  elseif (LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_STATIC_LIBRARY AND (TARGET unwind_static OR HAVE_LIBUNWIND))
74*c05d8e5dSAndroid Build Coastguard Worker      # We handle this by directly merging libunwind objects into libc++abi.
75*c05d8e5dSAndroid Build Coastguard Worker  else()
76*c05d8e5dSAndroid Build Coastguard Worker    list(APPEND LIBCXXABI_STATIC_LIBRARIES unwind)
77*c05d8e5dSAndroid Build Coastguard Worker  endif()
78*c05d8e5dSAndroid Build Coastguard Workerelse()
79*c05d8e5dSAndroid Build Coastguard Worker  add_library_flags_if(LIBCXXABI_HAS_GCC_S_LIB gcc_s)
80*c05d8e5dSAndroid Build Coastguard Workerendif()
81*c05d8e5dSAndroid Build Coastguard Workerif (MINGW)
82*c05d8e5dSAndroid Build Coastguard Worker  # MINGW_LIBRARIES is defined in config-ix.cmake
83*c05d8e5dSAndroid Build Coastguard Worker  list(APPEND LIBCXXABI_LIBRARIES ${MINGW_LIBRARIES})
84*c05d8e5dSAndroid Build Coastguard Workerendif()
85*c05d8e5dSAndroid Build Coastguard Worker
86*c05d8e5dSAndroid Build Coastguard Worker# Setup flags.
87*c05d8e5dSAndroid Build Coastguard Workeradd_link_flags_if_supported(-nodefaultlibs)
88*c05d8e5dSAndroid Build Coastguard Worker
89*c05d8e5dSAndroid Build Coastguard Workerset(LIBCXXABI_SHARED_LINK_FLAGS)
90*c05d8e5dSAndroid Build Coastguard Worker
91*c05d8e5dSAndroid Build Coastguard Workerif ( APPLE )
92*c05d8e5dSAndroid Build Coastguard Worker  if ( CMAKE_OSX_DEPLOYMENT_TARGET STREQUAL "10.6" )
93*c05d8e5dSAndroid Build Coastguard Worker    list(APPEND LIBCXXABI_COMPILE_FLAGS "-U__STRICT_ANSI__")
94*c05d8e5dSAndroid Build Coastguard Worker    list(APPEND LIBCXXABI_SHARED_LINK_FLAGS
95*c05d8e5dSAndroid Build Coastguard Worker      "-compatibility_version 1"
96*c05d8e5dSAndroid Build Coastguard Worker      "-current_version 1"
97*c05d8e5dSAndroid Build Coastguard Worker      "-install_name /usr/lib/libc++abi.1.dylib")
98*c05d8e5dSAndroid Build Coastguard Worker    list(APPEND LIBCXXABI_LINK_FLAGS
99*c05d8e5dSAndroid Build Coastguard Worker        "/usr/lib/libSystem.B.dylib")
100*c05d8e5dSAndroid Build Coastguard Worker  else()
101*c05d8e5dSAndroid Build Coastguard Worker    list(APPEND LIBCXXABI_SHARED_LINK_FLAGS
102*c05d8e5dSAndroid Build Coastguard Worker      "-compatibility_version 1"
103*c05d8e5dSAndroid Build Coastguard Worker      "-install_name /usr/lib/libc++abi.1.dylib")
104*c05d8e5dSAndroid Build Coastguard Worker  endif()
105*c05d8e5dSAndroid Build Coastguard Worker
106*c05d8e5dSAndroid Build Coastguard Worker  if (LLVM_USE_SANITIZER)
107*c05d8e5dSAndroid Build Coastguard Worker    if (("${LLVM_USE_SANITIZER}" STREQUAL "Address") OR
108*c05d8e5dSAndroid Build Coastguard Worker        ("${LLVM_USE_SANITIZER}" STREQUAL "Address;Undefined") OR
109*c05d8e5dSAndroid Build Coastguard Worker        ("${LLVM_USE_SANITIZER}" STREQUAL "Undefined;Address"))
110*c05d8e5dSAndroid Build Coastguard Worker      set(LIBFILE "libclang_rt.asan_osx_dynamic.dylib")
111*c05d8e5dSAndroid Build Coastguard Worker    elseif("${LLVM_USE_SANITIZER}" STREQUAL "Undefined")
112*c05d8e5dSAndroid Build Coastguard Worker      set(LIBFILE "libclang_rt.ubsan_osx_dynamic.dylib")
113*c05d8e5dSAndroid Build Coastguard Worker    elseif("${LLVM_USE_SANITIZER}" STREQUAL "Thread")
114*c05d8e5dSAndroid Build Coastguard Worker      set(LIBFILE "libclang_rt.tsan_osx_dynamic.dylib")
115*c05d8e5dSAndroid Build Coastguard Worker    else()
116*c05d8e5dSAndroid Build Coastguard Worker      message(WARNING "LLVM_USE_SANITIZER=${LLVM_USE_SANITIZER} is not supported on OS X")
117*c05d8e5dSAndroid Build Coastguard Worker    endif()
118*c05d8e5dSAndroid Build Coastguard Worker    if (LIBFILE)
119*c05d8e5dSAndroid Build Coastguard Worker      find_compiler_rt_dir(LIBDIR)
120*c05d8e5dSAndroid Build Coastguard Worker      if (NOT IS_DIRECTORY "${LIBDIR}")
121*c05d8e5dSAndroid Build Coastguard Worker        message(FATAL_ERROR "Cannot find compiler-rt directory on OS X required for LLVM_USE_SANITIZER")
122*c05d8e5dSAndroid Build Coastguard Worker      endif()
123*c05d8e5dSAndroid Build Coastguard Worker      set(LIBCXXABI_SANITIZER_LIBRARY "${LIBDIR}/${LIBFILE}")
124*c05d8e5dSAndroid Build Coastguard Worker      set(LIBCXXABI_SANITIZER_LIBRARY "${LIBCXXABI_SANITIZER_LIBRARY}" PARENT_SCOPE)
125*c05d8e5dSAndroid Build Coastguard Worker      message(STATUS "Manually linking compiler-rt library: ${LIBCXXABI_SANITIZER_LIBRARY}")
126*c05d8e5dSAndroid Build Coastguard Worker      add_library_flags("${LIBCXXABI_SANITIZER_LIBRARY}")
127*c05d8e5dSAndroid Build Coastguard Worker      add_link_flags("-Wl,-rpath,${LIBDIR}")
128*c05d8e5dSAndroid Build Coastguard Worker    endif()
129*c05d8e5dSAndroid Build Coastguard Worker  endif()
130*c05d8e5dSAndroid Build Coastguard Workerendif()
131*c05d8e5dSAndroid Build Coastguard Worker
132*c05d8e5dSAndroid Build Coastguard Workersplit_list(LIBCXXABI_COMPILE_FLAGS)
133*c05d8e5dSAndroid Build Coastguard Workersplit_list(LIBCXXABI_LINK_FLAGS)
134*c05d8e5dSAndroid Build Coastguard Workersplit_list(LIBCXXABI_SHARED_LINK_FLAGS)
135*c05d8e5dSAndroid Build Coastguard Worker
136*c05d8e5dSAndroid Build Coastguard Worker# FIXME: libc++abi.so will not link when modules are enabled because it depends
137*c05d8e5dSAndroid Build Coastguard Worker# on symbols defined in libc++.so which has not yet been built.
138*c05d8e5dSAndroid Build Coastguard Workerif (LLVM_ENABLE_MODULES)
139*c05d8e5dSAndroid Build Coastguard Worker  string(REPLACE "-Wl,-z,defs" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
140*c05d8e5dSAndroid Build Coastguard Workerendif()
141*c05d8e5dSAndroid Build Coastguard Worker
142*c05d8e5dSAndroid Build Coastguard Worker# Add a object library that contains the compiled source files.
143*c05d8e5dSAndroid Build Coastguard Workeradd_library(cxxabi_objects OBJECT ${LIBCXXABI_SOURCES} ${LIBCXXABI_HEADERS})
144*c05d8e5dSAndroid Build Coastguard Workerset_target_properties(cxxabi_objects
145*c05d8e5dSAndroid Build Coastguard Worker                      PROPERTIES
146*c05d8e5dSAndroid Build Coastguard Worker                        CXX_EXTENSIONS
147*c05d8e5dSAndroid Build Coastguard Worker                          OFF
148*c05d8e5dSAndroid Build Coastguard Worker                        CXX_STANDARD
149*c05d8e5dSAndroid Build Coastguard Worker                          11
150*c05d8e5dSAndroid Build Coastguard Worker                        CXX_STANDARD_REQUIRED
151*c05d8e5dSAndroid Build Coastguard Worker                          ON
152*c05d8e5dSAndroid Build Coastguard Worker                        COMPILE_FLAGS
153*c05d8e5dSAndroid Build Coastguard Worker                          "${LIBCXXABI_COMPILE_FLAGS}"
154*c05d8e5dSAndroid Build Coastguard Worker                        POSITION_INDEPENDENT_CODE
155*c05d8e5dSAndroid Build Coastguard Worker                          ON)
156*c05d8e5dSAndroid Build Coastguard Worker
157*c05d8e5dSAndroid Build Coastguard Worker# Build the shared library.
158*c05d8e5dSAndroid Build Coastguard Workerif (LIBCXXABI_ENABLE_SHARED)
159*c05d8e5dSAndroid Build Coastguard Worker  add_library(cxxabi_shared SHARED $<TARGET_OBJECTS:cxxabi_objects>)
160*c05d8e5dSAndroid Build Coastguard Worker  if(COMMAND llvm_setup_rpath)
161*c05d8e5dSAndroid Build Coastguard Worker    llvm_setup_rpath(cxxabi_shared)
162*c05d8e5dSAndroid Build Coastguard Worker  endif()
163*c05d8e5dSAndroid Build Coastguard Worker  target_link_libraries(cxxabi_shared ${LIBCXXABI_LIBRARIES} ${LIBCXXABI_SHARED_LIBRARIES})
164*c05d8e5dSAndroid Build Coastguard Worker  set_target_properties(cxxabi_shared
165*c05d8e5dSAndroid Build Coastguard Worker                        PROPERTIES
166*c05d8e5dSAndroid Build Coastguard Worker                          CXX_EXTENSIONS
167*c05d8e5dSAndroid Build Coastguard Worker                            OFF
168*c05d8e5dSAndroid Build Coastguard Worker                          CXX_STANDARD
169*c05d8e5dSAndroid Build Coastguard Worker                            11
170*c05d8e5dSAndroid Build Coastguard Worker                          CXX_STANDARD_REQUIRED
171*c05d8e5dSAndroid Build Coastguard Worker                            ON
172*c05d8e5dSAndroid Build Coastguard Worker                          LINK_FLAGS
173*c05d8e5dSAndroid Build Coastguard Worker                            "${LIBCXXABI_LINK_FLAGS} ${LIBCXXABI_SHARED_LINK_FLAGS}"
174*c05d8e5dSAndroid Build Coastguard Worker                          OUTPUT_NAME
175*c05d8e5dSAndroid Build Coastguard Worker                            "c++abi"
176*c05d8e5dSAndroid Build Coastguard Worker                          POSITION_INDEPENDENT_CODE
177*c05d8e5dSAndroid Build Coastguard Worker                            ON
178*c05d8e5dSAndroid Build Coastguard Worker                          SOVERSION
179*c05d8e5dSAndroid Build Coastguard Worker                            "1"
180*c05d8e5dSAndroid Build Coastguard Worker                          VERSION
181*c05d8e5dSAndroid Build Coastguard Worker                            "1.0")
182*c05d8e5dSAndroid Build Coastguard Worker  list(APPEND LIBCXXABI_BUILD_TARGETS "cxxabi_shared")
183*c05d8e5dSAndroid Build Coastguard Worker  if (LIBCXXABI_INSTALL_SHARED_LIBRARY)
184*c05d8e5dSAndroid Build Coastguard Worker    list(APPEND LIBCXXABI_INSTALL_TARGETS "cxxabi_shared")
185*c05d8e5dSAndroid Build Coastguard Worker  endif()
186*c05d8e5dSAndroid Build Coastguard Workerendif()
187*c05d8e5dSAndroid Build Coastguard Worker
188*c05d8e5dSAndroid Build Coastguard Worker# Build the static library.
189*c05d8e5dSAndroid Build Coastguard Workerif (LIBCXXABI_ENABLE_STATIC)
190*c05d8e5dSAndroid Build Coastguard Worker  set(cxxabi_static_sources $<TARGET_OBJECTS:cxxabi_objects>)
191*c05d8e5dSAndroid Build Coastguard Worker  if (LIBCXXABI_USE_LLVM_UNWINDER AND LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_STATIC_LIBRARY)
192*c05d8e5dSAndroid Build Coastguard Worker    if (TARGET unwind_static OR HAVE_LIBUNWIND)
193*c05d8e5dSAndroid Build Coastguard Worker      list(APPEND cxxabi_static_sources $<TARGET_OBJECTS:unwind_objects>)
194*c05d8e5dSAndroid Build Coastguard Worker    endif()
195*c05d8e5dSAndroid Build Coastguard Worker  endif()
196*c05d8e5dSAndroid Build Coastguard Worker  add_library(cxxabi_static STATIC ${cxxabi_static_sources})
197*c05d8e5dSAndroid Build Coastguard Worker  target_link_libraries(cxxabi_static ${LIBCXXABI_LIBRARIES} ${LIBCXXABI_STATIC_LIBRARIES})
198*c05d8e5dSAndroid Build Coastguard Worker  set_target_properties(cxxabi_static
199*c05d8e5dSAndroid Build Coastguard Worker                        PROPERTIES
200*c05d8e5dSAndroid Build Coastguard Worker                          CXX_EXTENSIONS
201*c05d8e5dSAndroid Build Coastguard Worker                            OFF
202*c05d8e5dSAndroid Build Coastguard Worker                          CXX_STANDARD
203*c05d8e5dSAndroid Build Coastguard Worker                            11
204*c05d8e5dSAndroid Build Coastguard Worker                          CXX_STANDARD_REQUIRED
205*c05d8e5dSAndroid Build Coastguard Worker                            ON
206*c05d8e5dSAndroid Build Coastguard Worker                          LINK_FLAGS
207*c05d8e5dSAndroid Build Coastguard Worker                            "${LIBCXXABI_LINK_FLAGS}"
208*c05d8e5dSAndroid Build Coastguard Worker                          OUTPUT_NAME
209*c05d8e5dSAndroid Build Coastguard Worker                            "c++abi"
210*c05d8e5dSAndroid Build Coastguard Worker                          POSITION_INDEPENDENT_CODE
211*c05d8e5dSAndroid Build Coastguard Worker                            ON)
212*c05d8e5dSAndroid Build Coastguard Worker  list(APPEND LIBCXXABI_BUILD_TARGETS "cxxabi_static")
213*c05d8e5dSAndroid Build Coastguard Worker  if (LIBCXXABI_INSTALL_STATIC_LIBRARY)
214*c05d8e5dSAndroid Build Coastguard Worker    list(APPEND LIBCXXABI_INSTALL_TARGETS "cxxabi_static")
215*c05d8e5dSAndroid Build Coastguard Worker  endif()
216*c05d8e5dSAndroid Build Coastguard Workerendif()
217*c05d8e5dSAndroid Build Coastguard Worker
218*c05d8e5dSAndroid Build Coastguard Worker# Add a meta-target for both libraries.
219*c05d8e5dSAndroid Build Coastguard Workeradd_custom_target(cxxabi DEPENDS ${LIBCXXABI_BUILD_TARGETS})
220*c05d8e5dSAndroid Build Coastguard Worker
221*c05d8e5dSAndroid Build Coastguard Workerif (LIBCXXABI_INSTALL_LIBRARY)
222*c05d8e5dSAndroid Build Coastguard Worker  install(TARGETS ${LIBCXXABI_INSTALL_TARGETS}
223*c05d8e5dSAndroid Build Coastguard Worker    LIBRARY DESTINATION ${LIBCXXABI_INSTALL_PREFIX}lib${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi
224*c05d8e5dSAndroid Build Coastguard Worker    ARCHIVE DESTINATION ${LIBCXXABI_INSTALL_PREFIX}lib${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi
225*c05d8e5dSAndroid Build Coastguard Worker    )
226*c05d8e5dSAndroid Build Coastguard Workerendif()
227*c05d8e5dSAndroid Build Coastguard Worker
228*c05d8e5dSAndroid Build Coastguard Workerif (NOT CMAKE_CONFIGURATION_TYPES AND LIBCXXABI_INSTALL_LIBRARY)
229*c05d8e5dSAndroid Build Coastguard Worker  add_custom_target(install-cxxabi
230*c05d8e5dSAndroid Build Coastguard Worker    DEPENDS cxxabi
231*c05d8e5dSAndroid Build Coastguard Worker    COMMAND "${CMAKE_COMMAND}"
232*c05d8e5dSAndroid Build Coastguard Worker            -DCMAKE_INSTALL_COMPONENT=cxxabi
233*c05d8e5dSAndroid Build Coastguard Worker            -P "${LIBCXXABI_BINARY_DIR}/cmake_install.cmake")
234*c05d8e5dSAndroid Build Coastguard Worker  add_custom_target(install-cxxabi-stripped
235*c05d8e5dSAndroid Build Coastguard Worker    DEPENDS cxxabi
236*c05d8e5dSAndroid Build Coastguard Worker    COMMAND "${CMAKE_COMMAND}"
237*c05d8e5dSAndroid Build Coastguard Worker            -DCMAKE_INSTALL_COMPONENT=cxxabi
238*c05d8e5dSAndroid Build Coastguard Worker            -DCMAKE_INSTALL_DO_STRIP=1
239*c05d8e5dSAndroid Build Coastguard Worker            -P "${LIBCXXABI_BINARY_DIR}/cmake_install.cmake")
240*c05d8e5dSAndroid Build Coastguard Worker
241*c05d8e5dSAndroid Build Coastguard Worker  # TODO: This is a legacy target name and should be removed at some point.
242*c05d8e5dSAndroid Build Coastguard Worker  add_custom_target(install-libcxxabi DEPENDS install-cxxabi)
243*c05d8e5dSAndroid Build Coastguard Workerendif()
244