[DebugInfo][RemoveDIs] Emulate inserting insts in dbg.value sequences (#73350)
[llvm-project.git] / libcxxabi / include / CMakeLists.txt
blob5b1cc2545016ec2a215a300dae65f9cb752b1996
1 set(files
2   __cxxabi_config.h
3   cxxabi.h
4   )
6 foreach(f ${files})
7   set(src "${CMAKE_CURRENT_SOURCE_DIR}/${f}")
8   set(dst "${LIBCXXABI_GENERATED_INCLUDE_DIR}/${f}")
9   add_custom_command(OUTPUT ${dst}
10     DEPENDS ${src}
11     COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
12     COMMENT "Copying CXXABI header ${f}")
13   list(APPEND _all_includes "${dst}")
14 endforeach()
16 add_custom_target(generate-cxxabi-headers ALL DEPENDS ${_all_includes})
18 add_library(cxxabi-headers INTERFACE)
19 add_dependencies(cxxabi-headers generate-cxxabi-headers)
20 target_include_directories(cxxabi-headers INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}")
22 if (LIBCXXABI_INSTALL_HEADERS)
23   foreach(file ${files})
24     get_filename_component(dir ${file} DIRECTORY)
25     install(FILES ${file}
26       DESTINATION ${LIBCXXABI_INSTALL_INCLUDE_DIR}/${dir}
27       COMPONENT cxxabi-headers
28       PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
29     )
30   endforeach()
32   add_custom_target(install-cxxabi-headers
33                     DEPENDS cxxabi-headers
34                     COMMAND "${CMAKE_COMMAND}"
35                             -DCMAKE_INSTALL_COMPONENT=cxxabi-headers
36                             -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
37   # Stripping is a no-op for headers
38   add_custom_target(install-cxxabi-headers-stripped DEPENDS install-cxxabi-headers)
39 endif()