1 # See www/CMake.html for instructions on how to build libcxxabi with CMake.
3 #===============================================================================
5 #===============================================================================
7 cmake_minimum_required(VERSION 3.20.0)
9 set(LLVM_COMMON_CMAKE_UTILS "${CMAKE_CURRENT_SOURCE_DIR}/../cmake")
11 # Add path for custom modules
12 list(INSERT CMAKE_MODULE_PATH 0
13 "${CMAKE_CURRENT_SOURCE_DIR}/cmake"
14 "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules"
15 "${CMAKE_CURRENT_SOURCE_DIR}/../runtimes/cmake/Modules"
16 "${LLVM_COMMON_CMAKE_UTILS}"
17 "${LLVM_COMMON_CMAKE_UTILS}/Modules"
20 set(CMAKE_FOLDER "libc++")
22 set(LIBCXXABI_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
23 set(LIBCXXABI_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
24 set(LIBCXXABI_LIBCXX_PATH "${CMAKE_CURRENT_LIST_DIR}/../libcxx" CACHE PATH
25 "Specify path to libc++ source.")
27 include(GNUInstallDirs)
29 # Require out of source build.
30 include(MacroEnsureOutOfSourceBuild)
31 MACRO_ENSURE_OUT_OF_SOURCE_BUILD(
32 "${PROJECT_NAME} requires an out of source build. Please create a separate
33 build directory and run 'cmake /path/to/${PROJECT_NAME} [options]' there."
36 #===============================================================================
38 #===============================================================================
39 include(CMakeDependentOption)
40 include(HandleCompilerRT)
43 option(LIBCXXABI_ENABLE_EXCEPTIONS
44 "Provide support for exceptions in the runtime.
45 When disabled, libc++abi does not support stack unwinding and other exceptions-related features." ON)
46 option(LIBCXXABI_ENABLE_ASSERTIONS "Enable assertions independent of build mode." ON)
47 option(LIBCXXABI_ENABLE_PEDANTIC "Compile with pedantic enabled." OFF)
48 option(LIBCXXABI_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF)
49 option(LIBCXXABI_USE_LLVM_UNWINDER "Build and use the LLVM unwinder." OFF)
50 option(LIBCXXABI_ENABLE_STATIC_UNWINDER "Statically link the LLVM unwinder." OFF)
51 option(LIBCXXABI_USE_COMPILER_RT "Use compiler-rt instead of libgcc" OFF)
52 option(LIBCXXABI_ENABLE_THREADS "Build with threads enabled" ON)
53 option(LIBCXXABI_HAS_PTHREAD_API "Ignore auto-detection and force use of pthread API" OFF)
54 option(LIBCXXABI_HAS_WIN32_THREAD_API "Ignore auto-detection and force use of win32 thread API" OFF)
55 option(LIBCXXABI_HAS_EXTERNAL_THREAD_API
56 "Build libc++abi with an externalized threading API.
57 This option may only be set to ON when LIBCXXABI_ENABLE_THREADS=ON." OFF)
58 option(LIBCXXABI_ENABLE_FORGIVING_DYNAMIC_CAST
59 "Make dynamic_cast more forgiving when type_info's mistakenly have hidden \
60 visibility, and thus multiple type_infos can exist for a single type. \
61 When the dynamic_cast would normally fail, this option will cause the \
62 library to try comparing the type_info names to see if they are equal \
65 option(LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS
66 "Build libc++abi with definitions for operator new/delete. These are normally
67 defined in libc++abi, but it is also possible to define them in libc++, in
68 which case the definition in libc++abi should be turned off." ON)
69 option(LIBCXXABI_BUILD_32_BITS "Build 32 bit multilib libc++abi. This option is not supported anymore when building the runtimes. Please specify a full triple instead." ${LLVM_BUILD_32_BITS})
70 if (LIBCXXABI_BUILD_32_BITS)
71 message(FATAL_ERROR "LIBCXXABI_BUILD_32_BITS is not supported anymore when building the runtimes, please specify a full triple instead.")
74 option(LIBCXXABI_INCLUDE_TESTS "Generate build targets for the libc++abi unit tests." ${LLVM_INCLUDE_TESTS})
75 set(LIBCXXABI_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}" CACHE STRING
76 "Define suffix of library directory name (32/64)")
77 option(LIBCXXABI_INSTALL_HEADERS "Install the libc++abi headers." ON)
78 option(LIBCXXABI_INSTALL_LIBRARY "Install the libc++abi library." ON)
80 set(LIBCXXABI_SHARED_OUTPUT_NAME "c++abi" CACHE STRING "Output name for the shared libc++abi runtime library.")
81 set(LIBCXXABI_STATIC_OUTPUT_NAME "c++abi" CACHE STRING "Output name for the static libc++abi runtime library.")
83 set(LIBCXXABI_INSTALL_INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/c++/v1" CACHE PATH "Path to install the libc++abi headers at.")
85 if(LLVM_LIBRARY_OUTPUT_INTDIR)
86 set(LIBCXXABI_GENERATED_INCLUDE_DIR "${LLVM_BINARY_DIR}/include/c++/v1")
88 set(LIBCXXABI_GENERATED_INCLUDE_DIR "${CMAKE_BINARY_DIR}/include/c++/v1")
91 # TODO: Remove this after branching for LLVM 15
92 if(LIBCXXABI_SYSROOT OR LIBCXXABI_TARGET_TRIPLE OR LIBCXXABI_GCC_TOOLCHAIN)
93 message(WARNING "LIBCXXABI_SYSROOT, LIBCXXABI_TARGET_TRIPLE and LIBCXXABI_GCC_TOOLCHAIN are not supported anymore, please use the native CMake equivalents instead")
96 set(LIBCXXABI_LIBCXX_LIBRARY_PATH "" CACHE PATH "The path to libc++ library.")
97 set(LIBCXXABI_LIBRARY_VERSION "1.0" CACHE STRING
98 "Version of libc++abi. This will be reflected in the name of the shared \
99 library produced. For example, -DLIBCXXABI_LIBRARY_VERSION=x.y will \
100 result in the library being named libc++abi.x.y.dylib, along with the \
101 usual symlinks pointing to that.")
103 # Default to building a shared library so that the default options still test
104 # the libc++abi that is being built. The problem with testing a static libc++abi
105 # is that libc++ will prefer a dynamic libc++abi from the system over a static
106 # libc++abi from the output directory.
107 option(LIBCXXABI_ENABLE_SHARED "Build libc++abi as a shared library." ON)
108 option(LIBCXXABI_ENABLE_STATIC "Build libc++abi as a static library." ON)
110 cmake_dependent_option(LIBCXXABI_INSTALL_STATIC_LIBRARY
111 "Install the static libc++abi library." ON
112 "LIBCXXABI_ENABLE_STATIC;LIBCXXABI_INSTALL_LIBRARY" OFF)
113 cmake_dependent_option(LIBCXXABI_INSTALL_SHARED_LIBRARY
114 "Install the shared libc++abi library." ON
115 "LIBCXXABI_ENABLE_SHARED;LIBCXXABI_INSTALL_LIBRARY" OFF)
117 cmake_dependent_option(LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_STATIC_LIBRARY
118 "Statically link the LLVM unwinder to static library" ON
119 "LIBCXXABI_ENABLE_STATIC_UNWINDER" OFF)
120 cmake_dependent_option(LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_SHARED_LIBRARY
121 "Statically link the LLVM unwinder to shared library" ON
122 "LIBCXXABI_ENABLE_STATIC_UNWINDER" OFF)
124 option(LIBCXXABI_BAREMETAL "Build libc++abi for baremetal targets." OFF)
125 # The default terminate handler attempts to demangle uncaught exceptions, which
126 # causes extra I/O and demangling code to be pulled in.
127 option(LIBCXXABI_SILENT_TERMINATE "Set this to make the terminate handler default to a silent alternative" OFF)
128 option(LIBCXXABI_NON_DEMANGLING_TERMINATE "Set this to make the terminate handler
129 avoid demangling" OFF)
131 if (NOT LIBCXXABI_ENABLE_SHARED AND NOT LIBCXXABI_ENABLE_STATIC)
132 message(FATAL_ERROR "libc++abi must be built as either a shared or static library.")
135 # TODO: Remove this, which shouldn't be necessary since we know we're being built
136 # side-by-side with libc++.
137 set(LIBCXXABI_LIBCXX_INCLUDES "" CACHE PATH
138 "Specify path to libc++ includes.")
140 set(LIBCXXABI_HERMETIC_STATIC_LIBRARY_DEFAULT OFF)
142 set(LIBCXXABI_HERMETIC_STATIC_LIBRARY_DEFAULT ON)
144 option(LIBCXXABI_HERMETIC_STATIC_LIBRARY
145 "Do not export any symbols from the static library." ${LIBCXXABI_HERMETIC_STATIC_LIBRARY_DEFAULT})
147 if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
148 set(LIBCXXABI_DEFAULT_TEST_CONFIG "llvm-libc++abi-shared-gcc.cfg.in")
150 set(LIBCXXABI_DEFAULT_TEST_CONFIG "llvm-libc++abi-mingw.cfg.in")
151 elseif(WIN32) # clang-cl
152 if (LIBCXXABI_ENABLE_SHARED)
153 set(LIBCXXABI_DEFAULT_TEST_CONFIG "llvm-libc++abi-shared-clangcl.cfg.in")
155 set(LIBCXXABI_DEFAULT_TEST_CONFIG "llvm-libc++abi-static-clangcl.cfg.in")
158 if (LIBCXXABI_ENABLE_SHARED)
159 set(LIBCXXABI_DEFAULT_TEST_CONFIG "llvm-libc++abi-shared.cfg.in")
161 set(LIBCXXABI_DEFAULT_TEST_CONFIG "llvm-libc++abi-static.cfg.in")
164 set(LIBCXXABI_TEST_CONFIG "${LIBCXXABI_DEFAULT_TEST_CONFIG}" CACHE STRING
165 "The path to the Lit testing configuration to use when running the tests.
166 If a relative path is provided, it is assumed to be relative to '<monorepo>/libcxxabi/test/configs'.")
167 if (NOT IS_ABSOLUTE "${LIBCXXABI_TEST_CONFIG}")
168 set(LIBCXXABI_TEST_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/test/configs/${LIBCXXABI_TEST_CONFIG}")
170 message(STATUS "Using libc++abi testing configuration: ${LIBCXXABI_TEST_CONFIG}")
171 set(LIBCXXABI_TEST_PARAMS "" CACHE STRING
172 "A list of parameters to run the Lit test suite with.")
174 #===============================================================================
176 #===============================================================================
178 # Add path for custom modules
179 set(CMAKE_MODULE_PATH
180 "${CMAKE_CURRENT_SOURCE_DIR}/cmake"
181 "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules"
185 set(LIBCXXABI_INSTALL_RUNTIME_DIR "${CMAKE_INSTALL_BINDIR}" CACHE PATH
186 "Path where built libc++abi runtime libraries should be installed.")
188 if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
189 set(LIBCXXABI_HEADER_DIR ${LLVM_BINARY_DIR})
190 set(LIBCXXABI_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE})
191 set(LIBCXXABI_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE PATH
192 "Path where built libc++abi libraries should be installed.")
193 if(LIBCXX_LIBDIR_SUBDIR)
194 string(APPEND LIBCXXABI_LIBRARY_DIR /${LIBCXXABI_LIBDIR_SUBDIR})
195 string(APPEND LIBCXXABI_INSTALL_LIBRARY_DIR /${LIBCXXABI_LIBDIR_SUBDIR})
198 if(LLVM_LIBRARY_OUTPUT_INTDIR)
199 set(LIBCXXABI_HEADER_DIR ${LLVM_BINARY_DIR})
200 set(LIBCXXABI_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
202 set(LIBCXXABI_HEADER_DIR ${CMAKE_BINARY_DIR})
203 set(LIBCXXABI_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXXABI_LIBDIR_SUFFIX})
205 set(LIBCXXABI_INSTALL_LIBRARY_DIR lib${LIBCXXABI_LIBDIR_SUFFIX} CACHE PATH
206 "Path where built libc++abi libraries should be installed.")
209 set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBCXXABI_LIBRARY_DIR})
210 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIBCXXABI_LIBRARY_DIR})
211 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LIBCXXABI_LIBRARY_DIR})
213 # By default, libcxx and libcxxabi share a library directory.
214 if (NOT LIBCXXABI_LIBCXX_LIBRARY_PATH)
215 set(LIBCXXABI_LIBCXX_LIBRARY_PATH "${LIBCXXABI_LIBRARY_DIR}" CACHE PATH
216 "The path to libc++ library." FORCE)
219 # Declare libc++abi configuration variables.
220 # They are intended for use as follows:
221 # LIBCXXABI_C_FLAGS: General flags for both the c++ compiler and linker.
222 # LIBCXXABI_CXX_FLAGS: General flags for both the c++ compiler and linker.
223 # LIBCXXABI_COMPILE_FLAGS: Compile only flags.
224 # LIBCXXABI_LINK_FLAGS: Linker only flags.
225 # LIBCXXABI_LIBRARIES: libraries libc++abi is linked to.
227 set(LIBCXXABI_C_FLAGS "")
228 set(LIBCXXABI_CXX_FLAGS "")
229 set(LIBCXXABI_COMPILE_FLAGS "")
230 set(LIBCXXABI_LINK_FLAGS "")
231 set(LIBCXXABI_LIBRARIES "")
232 set(LIBCXXABI_ADDITIONAL_COMPILE_FLAGS "" CACHE STRING
233 "Additional Compile only flags which can be provided in cache")
234 set(LIBCXXABI_ADDITIONAL_LIBRARIES "" CACHE STRING
235 "Additional libraries libc++abi is linked to which can be provided in cache")
237 # Include macros for adding and removing libc++abi flags.
238 include(HandleLibcxxabiFlags)
240 #===============================================================================
241 # Setup Compiler Flags
242 #===============================================================================
244 # Configure target flags
245 if (${CMAKE_SYSTEM_NAME} MATCHES "AIX")
246 add_flags_if_supported("-mdefault-visibility-export-mapping=explicit")
247 set(CMAKE_AIX_EXPORT_ALL_SYMBOLS OFF)
249 add_compile_flags("${LIBCXXABI_ADDITIONAL_COMPILE_FLAGS}")
250 add_library_flags("${LIBCXXABI_ADDITIONAL_LIBRARIES}")
252 # Configure compiler. Must happen after setting the target flags.
255 if (CXX_SUPPORTS_NOSTDINCXX_FLAG)
256 list(APPEND LIBCXXABI_COMPILE_FLAGS -nostdinc++)
257 # cmake 3.14 and above remove system include paths that are explicitly
258 # passed on the command line. We build with -nostdinc++ and explicitly add
259 # just the libcxx system include paths with -I on the command line.
260 # Setting CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES effectively prevents cmake
261 # from removing these.
262 # See: https://gitlab.kitware.com/cmake/cmake/issues/19227
263 set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "")
264 # Remove -stdlib flags to prevent them from causing an unused flag warning.
265 string(REPLACE "--stdlib=libc++" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
266 string(REPLACE "--stdlib=libstdc++" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
267 string(REPLACE "-stdlib=libc++" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
268 string(REPLACE "-stdlib=libstdc++" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
271 # Let the library headers know they are currently being used to build the
273 add_definitions(-D_LIBCXXABI_BUILDING_LIBRARY)
275 # libcxxabi needs to, for various reasons, include the libcpp headers as if
276 # it is being built as part of libcxx.
277 add_definitions(-D_LIBCPP_BUILDING_LIBRARY)
280 add_compile_flags_if_supported(-fstrict-aliasing)
283 if (LIBCXXABI_ENABLE_EXCEPTIONS)
284 # Catches C++ exceptions only and tells the compiler to assume that extern C
285 # functions never throw a C++ exception.
286 add_compile_flags_if_supported(-EHsc)
287 # Do we really need to be run through the C compiler ?
288 add_c_compile_flags_if_supported(-funwind-tables)
290 add_compile_flags_if_supported(-fno-exceptions)
291 add_compile_flags_if_supported(-EHs-)
292 add_compile_flags_if_supported(-EHa-)
296 string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
297 if (LIBCXXABI_ENABLE_ASSERTIONS)
298 # MSVC doesn't like _DEBUG on release builds. See PR 4379.
300 list(APPEND LIBCXXABI_COMPILE_FLAGS -D_DEBUG)
302 # On Release builds cmake automatically defines NDEBUG, so we
303 # explicitly undefine it:
304 if (uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE")
305 list(APPEND LIBCXXABI_COMPILE_FLAGS -UNDEBUG)
308 if (NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE")
309 list(APPEND LIBCXXABI_COMPILE_FLAGS -DNDEBUG)
314 if (NOT LIBCXXABI_ENABLE_THREADS)
315 if (LIBCXXABI_HAS_PTHREAD_API)
316 message(FATAL_ERROR "LIBCXXABI_HAS_PTHREAD_API can only"
317 " be set to ON when LIBCXXABI_ENABLE_THREADS"
318 " is also set to ON.")
320 if (LIBCXXABI_HAS_WIN32_THREAD_API)
321 message(FATAL_ERROR "LIBCXXABI_HAS_WIN32_THREAD_API can only"
322 " be set to ON when LIBCXXABI_ENABLE_THREADS"
323 " is also set to ON.")
325 if (LIBCXXABI_HAS_EXTERNAL_THREAD_API)
326 message(FATAL_ERROR "LIBCXXABI_HAS_EXTERNAL_THREAD_API can only"
327 " be set to ON when LIBCXXABI_ENABLE_THREADS"
328 " is also set to ON.")
330 add_definitions(-D_LIBCXXABI_HAS_NO_THREADS)
333 if (LIBCXXABI_HAS_EXTERNAL_THREAD_API)
334 if (LIBCXXABI_HAS_PTHREAD_API)
335 message(FATAL_ERROR "The options LIBCXXABI_HAS_EXTERNAL_THREAD_API"
336 " and LIBCXXABI_HAS_PTHREAD_API cannot be both"
337 " set to ON at the same time.")
339 if (LIBCXXABI_HAS_WIN32_THREAD_API)
340 message(FATAL_ERROR "The options LIBCXXABI_HAS_EXTERNAL_THREAD_API"
341 " and LIBCXXABI_HAS_WIN32_THREAD_API cannot be both"
342 " set to ON at the same time.")
346 if (LIBCXXABI_HAS_PTHREAD_API)
347 if (LIBCXXABI_HAS_WIN32_THREAD_API)
348 message(FATAL_ERROR "The options LIBCXXABI_HAS_PTHREAD_API"
349 "and LIBCXXABI_HAS_WIN32_THREAD_API cannot be both"
350 "set to ON at the same time.")
354 if (LLVM_ENABLE_MODULES)
355 # Ignore that the rest of the modules flags are now unused.
356 add_compile_flags_if_supported(-Wno-unused-command-line-argument)
357 add_compile_flags(-fno-modules)
360 set(LIBCXXABI_HAS_UNDEFINED_SYMBOLS OFF)
361 if ((NOT LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS) OR MINGW)
362 set(LIBCXXABI_HAS_UNDEFINED_SYMBOLS ON)
365 if (LIBCXXABI_HAS_UNDEFINED_SYMBOLS)
366 # Need to allow unresolved symbols if this is to work with shared library builds
368 list(APPEND LIBCXXABI_LINK_FLAGS "-undefined dynamic_lookup")
370 # Relax this restriction from HandleLLVMOptions
371 string(REPLACE "-Wl,-z,defs" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
375 if (LIBCXXABI_HAS_PTHREAD_API)
376 add_definitions(-D_LIBCPP_HAS_THREAD_API_PTHREAD)
379 if (LIBCXXABI_HAS_WIN32_THREAD_API)
380 add_definitions(-D_LIBCPP_HAS_THREAD_API_WIN32)
383 if (LIBCXXABI_HAS_EXTERNAL_THREAD_API)
384 add_definitions(-D_LIBCPP_HAS_THREAD_API_EXTERNAL)
388 add_definitions(-D_CRT_SECURE_NO_WARNINGS)
391 if (LIBCXXABI_SILENT_TERMINATE)
392 add_definitions(-DLIBCXXABI_SILENT_TERMINATE)
395 if (LIBCXXABI_NON_DEMANGLING_TERMINATE)
396 add_definitions(-DLIBCXXABI_NON_DEMANGLING_TERMINATE)
399 if (LIBCXXABI_BAREMETAL)
400 add_definitions(-DLIBCXXABI_BAREMETAL)
403 if (C_SUPPORTS_COMMENT_LIB_PRAGMA)
404 if (LIBCXXABI_HAS_PTHREAD_LIB)
405 add_definitions(-D_LIBCXXABI_LINK_PTHREAD_LIB)
409 string(REPLACE ";" " " LIBCXXABI_CXX_FLAGS "${LIBCXXABI_CXX_FLAGS}")
410 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LIBCXXABI_CXX_FLAGS}")
411 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBCXXABI_C_FLAGS}")
413 # On AIX, avoid picking up VMX extensions(i.e. vec_malloc) which would change
414 # the default alignment of the allocators here.
415 if (UNIX AND ${CMAKE_SYSTEM_NAME} MATCHES "AIX")
416 add_definitions("-D_XOPEN_SOURCE=700")
419 #===============================================================================
421 #===============================================================================
423 set(LIBCXXABI_LIBUNWIND_INCLUDES "${LIBCXXABI_LIBUNWIND_INCLUDES}" CACHE PATH
424 "Specify path to libunwind includes." FORCE)
425 set(LIBCXXABI_LIBUNWIND_PATH "${LIBCXXABI_LIBUNWIND_PATH}" CACHE PATH
426 "Specify path to libunwind source." FORCE)
428 if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM)
429 find_path(LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL libunwind.h
430 PATHS ${LIBCXXABI_LIBUNWIND_INCLUDES}
431 ${LIBCXXABI_LIBUNWIND_PATH}/include
432 ${CMAKE_BINARY_DIR}/${LIBCXXABI_LIBUNWIND_INCLUDES}
433 ${LLVM_MAIN_SRC_DIR}/projects/libunwind/include
434 ${LLVM_MAIN_SRC_DIR}/runtimes/libunwind/include
435 ${LLVM_MAIN_SRC_DIR}/../libunwind/include
437 NO_CMAKE_FIND_ROOT_PATH
440 if (LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL STREQUAL "LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL-NOTFOUND")
441 set(LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL "")
445 if (NOT "${LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL}" STREQUAL "")
446 include_directories("${LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL}")
449 # Add source code. This also contains all of the logic for deciding linker flags
451 add_subdirectory(include)
452 add_subdirectory(src)
454 if (LIBCXXABI_INCLUDE_TESTS)
455 add_subdirectory(test)
456 add_subdirectory(fuzz)