|
| 1 | +set(files |
| 2 | + __bit_reference |
| 3 | + __bsd_locale_defaults.h |
| 4 | + __bsd_locale_fallbacks.h |
| 5 | + __errc |
| 6 | + __debug |
| 7 | + __functional_03 |
| 8 | + __functional_base |
| 9 | + __functional_base_03 |
| 10 | + __hash_table |
| 11 | + __libcpp_version |
| 12 | + __locale |
| 13 | + __mutex_base |
| 14 | + __node_handle |
| 15 | + __nullptr |
| 16 | + __split_buffer |
| 17 | + __sso_allocator |
| 18 | + __std_stream |
| 19 | + __string |
| 20 | + __threading_support |
| 21 | + __tree |
| 22 | + __tuple |
| 23 | + __undef_macros |
| 24 | + algorithm |
| 25 | + any |
| 26 | + array |
| 27 | + atomic |
| 28 | + bit |
| 29 | + bitset |
| 30 | + cassert |
| 31 | + ccomplex |
| 32 | + cctype |
| 33 | + cerrno |
| 34 | + cfenv |
| 35 | + cfloat |
| 36 | + charconv |
| 37 | + chrono |
| 38 | + cinttypes |
| 39 | + ciso646 |
| 40 | + climits |
| 41 | + clocale |
| 42 | + cmath |
| 43 | + codecvt |
| 44 | + compare |
| 45 | + complex |
| 46 | + complex.h |
| 47 | + condition_variable |
| 48 | + csetjmp |
| 49 | + csignal |
| 50 | + cstdarg |
| 51 | + cstdbool |
| 52 | + cstddef |
| 53 | + cstdint |
| 54 | + cstdio |
| 55 | + cstdlib |
| 56 | + cstring |
| 57 | + ctgmath |
| 58 | + ctime |
| 59 | + ctype.h |
| 60 | + cwchar |
| 61 | + cwctype |
| 62 | + deque |
| 63 | + errno.h |
| 64 | + exception |
| 65 | + execution |
| 66 | + experimental/__config |
| 67 | + experimental/__memory |
| 68 | + experimental/algorithm |
| 69 | + experimental/coroutine |
| 70 | + experimental/deque |
| 71 | + experimental/filesystem |
| 72 | + experimental/forward_list |
| 73 | + experimental/functional |
| 74 | + experimental/iterator |
| 75 | + experimental/list |
| 76 | + experimental/map |
| 77 | + experimental/memory_resource |
| 78 | + experimental/propagate_const |
| 79 | + experimental/regex |
| 80 | + experimental/set |
| 81 | + experimental/simd |
| 82 | + experimental/string |
| 83 | + experimental/type_traits |
| 84 | + experimental/unordered_map |
| 85 | + experimental/unordered_set |
| 86 | + experimental/utility |
| 87 | + experimental/vector |
| 88 | + ext/__hash |
| 89 | + ext/hash_map |
| 90 | + ext/hash_set |
| 91 | + fenv.h |
| 92 | + filesystem |
| 93 | + float.h |
| 94 | + forward_list |
| 95 | + fstream |
| 96 | + functional |
| 97 | + future |
| 98 | + initializer_list |
| 99 | + inttypes.h |
| 100 | + iomanip |
| 101 | + ios |
| 102 | + iosfwd |
| 103 | + iostream |
| 104 | + istream |
| 105 | + iterator |
| 106 | + limits |
| 107 | + limits.h |
| 108 | + list |
| 109 | + locale |
| 110 | + locale.h |
| 111 | + map |
| 112 | + math.h |
| 113 | + memory |
| 114 | + module.modulemap |
| 115 | + mutex |
| 116 | + new |
| 117 | + numeric |
| 118 | + optional |
| 119 | + ostream |
| 120 | + queue |
| 121 | + random |
| 122 | + ratio |
| 123 | + regex |
| 124 | + scoped_allocator |
| 125 | + set |
| 126 | + setjmp.h |
| 127 | + shared_mutex |
| 128 | + span |
| 129 | + sstream |
| 130 | + stack |
| 131 | + stdbool.h |
| 132 | + stddef.h |
| 133 | + stdexcept |
| 134 | + stdint.h |
| 135 | + stdio.h |
| 136 | + stdlib.h |
| 137 | + streambuf |
| 138 | + string |
| 139 | + string.h |
| 140 | + string_view |
| 141 | + strstream |
| 142 | + system_error |
| 143 | + tgmath.h |
| 144 | + thread |
| 145 | + tuple |
| 146 | + type_traits |
| 147 | + typeindex |
| 148 | + typeinfo |
| 149 | + unordered_map |
| 150 | + unordered_set |
| 151 | + utility |
| 152 | + valarray |
| 153 | + variant |
| 154 | + vector |
| 155 | + version |
| 156 | + wchar.h |
| 157 | + wctype.h |
| 158 | + ) |
| 159 | + |
| 160 | +if(LIBCXX_INSTALL_SUPPORT_HEADERS) |
| 161 | + set(files |
| 162 | + ${files} |
| 163 | + support/android/locale_bionic.h |
| 164 | + support/fuchsia/xlocale.h |
| 165 | + support/ibm/limits.h |
| 166 | + support/ibm/locale_mgmt_aix.h |
| 167 | + support/ibm/support.h |
| 168 | + support/ibm/xlocale.h |
| 169 | + support/musl/xlocale.h |
| 170 | + support/newlib/xlocale.h |
| 171 | + support/solaris/floatingpoint.h |
| 172 | + support/solaris/wchar.h |
| 173 | + support/solaris/xlocale.h |
| 174 | + support/win32/limits_msvc_win32.h |
| 175 | + support/win32/locale_win32.h |
| 176 | + support/xlocale/__nop_locale_mgmt.h |
| 177 | + support/xlocale/__posix_l_fallback.h |
| 178 | + support/xlocale/__strtonum_fallback.h |
| 179 | + ) |
| 180 | +endif() |
| 181 | + |
| 182 | +if (LIBCXX_NEEDS_SITE_CONFIG) |
| 183 | + # Generate a custom __config header. The new header is created |
| 184 | + # by prepending __config_site to the current __config header. |
| 185 | + add_custom_command(OUTPUT ${LIBCXX_BINARY_DIR}/__generated_config |
| 186 | + COMMAND ${PYTHON_EXECUTABLE} ${LIBCXX_SOURCE_DIR}/utils/cat_files.py |
| 187 | + ${LIBCXX_BINARY_DIR}/__config_site |
| 188 | + ${LIBCXX_SOURCE_DIR}/include/__config |
| 189 | + -o ${LIBCXX_BINARY_DIR}/__generated_config |
| 190 | + DEPENDS ${LIBCXX_SOURCE_DIR}/include/__config |
| 191 | + ${LIBCXX_BINARY_DIR}/__config_site |
| 192 | + ) |
| 193 | + # Add a target that executes the generation commands. |
| 194 | + add_custom_target(cxx-generated-config ALL |
| 195 | + DEPENDS ${LIBCXX_BINARY_DIR}/__generated_config) |
| 196 | + set(generated_config_deps cxx-generated-config) |
| 197 | +else() |
| 198 | + set(files |
| 199 | + ${files} |
| 200 | + __config |
| 201 | + ) |
| 202 | +endif() |
| 203 | + |
| 204 | +# In some build configuraitons (like boostrapping clang), we need to be able to |
| 205 | +# install the libcxx headers before CMake configuraiton for libcxx runs. Making |
| 206 | +# the name of this target configurable allows LLVM/runtimes/CMakeLists.txt to |
| 207 | +# add this subdirectory to the LLVM build to put libcxx's headers in place |
| 208 | +# before libcxx's build configuration is run. |
| 209 | +if (NOT CXX_HEADER_TARGET) |
| 210 | + set(CXX_HEADER_TARGET cxx-headers) |
| 211 | +endif() |
| 212 | +if(NOT LIBCXX_USING_INSTALLED_LLVM AND LIBCXX_HEADER_DIR) |
| 213 | + set(output_dir ${LIBCXX_HEADER_DIR}/include/c++/v1) |
| 214 | + |
| 215 | + set(out_files) |
| 216 | + foreach(f ${files}) |
| 217 | + set(src ${CMAKE_CURRENT_SOURCE_DIR}/${f}) |
| 218 | + set(dst ${output_dir}/${f}) |
| 219 | + add_custom_command(OUTPUT ${dst} |
| 220 | + DEPENDS ${src} |
| 221 | + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst} |
| 222 | + COMMENT "Copying CXX header ${f}") |
| 223 | + list(APPEND out_files ${dst}) |
| 224 | + endforeach() |
| 225 | + |
| 226 | + if (LIBCXX_NEEDS_SITE_CONFIG) |
| 227 | + # Copy the generated header as __config into build directory. |
| 228 | + set(src ${LIBCXX_BINARY_DIR}/__generated_config) |
| 229 | + set(dst ${output_dir}/__config) |
| 230 | + add_custom_command(OUTPUT ${dst} |
| 231 | + DEPENDS ${src} ${generated_config_deps} |
| 232 | + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst} |
| 233 | + COMMENT "Copying CXX __config") |
| 234 | + list(APPEND out_files ${dst}) |
| 235 | + endif() |
| 236 | + |
| 237 | + add_custom_target(${CXX_HEADER_TARGET} ALL DEPENDS ${out_files} ${LIBCXX_CXX_ABI_HEADER_TARGET}) |
| 238 | +else() |
| 239 | + add_custom_target(${CXX_HEADER_TARGET}) |
| 240 | +endif() |
| 241 | +set_target_properties(${CXX_HEADER_TARGET} PROPERTIES FOLDER "Misc") |
| 242 | + |
| 243 | +if (LIBCXX_INSTALL_HEADERS) |
| 244 | + foreach(file ${files}) |
| 245 | + get_filename_component(dir ${file} DIRECTORY) |
| 246 | + install(FILES ${file} |
| 247 | + DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}include/c++/v1/${dir} |
| 248 | + COMPONENT ${CXX_HEADER_TARGET} |
| 249 | + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ |
| 250 | + ) |
| 251 | + endforeach() |
| 252 | + |
| 253 | + if (LIBCXX_NEEDS_SITE_CONFIG) |
| 254 | + # Install the generated header as __config. |
| 255 | + install(FILES ${LIBCXX_BINARY_DIR}/__generated_config |
| 256 | + DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}include/c++/v1 |
| 257 | + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ |
| 258 | + RENAME __config |
| 259 | + COMPONENT ${CXX_HEADER_TARGET}) |
| 260 | + endif() |
| 261 | + |
| 262 | + if (NOT CMAKE_CONFIGURATION_TYPES) |
| 263 | + add_custom_target(install-${CXX_HEADER_TARGET} |
| 264 | + DEPENDS ${CXX_HEADER_TARGET} ${generated_config_deps} |
| 265 | + COMMAND "${CMAKE_COMMAND}" |
| 266 | + -DCMAKE_INSTALL_COMPONENT=${CXX_HEADER_TARGET} |
| 267 | + -P "${CMAKE_BINARY_DIR}/cmake_install.cmake") |
| 268 | + # Stripping is a no-op for headers |
| 269 | + add_custom_target(install-${CXX_HEADER_TARGET}-stripped DEPENDS install-${CXX_HEADER_TARGET}) |
| 270 | + |
| 271 | + add_custom_target(install-libcxx-headers DEPENDS install-${CXX_HEADER_TARGET}) |
| 272 | + add_custom_target(install-libcxx-headers-stripped DEPENDS install-${CXX_HEADER_TARGET}-stripped) |
| 273 | + endif() |
| 274 | +endif() |
0 commit comments