brintos

brintos / llvm-project-archived public Read only

0
0
Text · 7.0 KiB · d47d19a Raw
270 lines · plain
1# The headers of Table 24: C++ library headers [tab:headers.cpp]2# and the headers of Table 25: C++ headers for C library facilities [tab:headers.cpp.c]3set(LIBCXX_MODULE_STD_SOURCES4  std/algorithm.inc5  std/any.inc6  std/array.inc7  std/atomic.inc8  std/barrier.inc9  std/bit.inc10  std/bitset.inc11  std/cassert.inc12  std/cctype.inc13  std/cerrno.inc14  std/cfenv.inc15  std/cfloat.inc16  std/charconv.inc17  std/chrono.inc18  std/cinttypes.inc19  std/climits.inc20  std/clocale.inc21  std/cmath.inc22  std/codecvt.inc23  std/compare.inc24  std/complex.inc25  std/concepts.inc26  std/condition_variable.inc27  std/coroutine.inc28  std/csetjmp.inc29  std/csignal.inc30  std/cstdarg.inc31  std/cstddef.inc32  std/cstdint.inc33  std/cstdio.inc34  std/cstdlib.inc35  std/cstring.inc36  std/ctime.inc37  std/cuchar.inc38  std/cwchar.inc39  std/cwctype.inc40  std/deque.inc41  std/exception.inc42  std/execution.inc43  std/expected.inc44  std/filesystem.inc45  std/flat_map.inc46  std/flat_set.inc47  std/format.inc48  std/forward_list.inc49  std/fstream.inc50  std/functional.inc51  std/future.inc52  std/generator.inc53  std/hazard_pointer.inc54  std/initializer_list.inc55  std/iomanip.inc56  std/ios.inc57  std/iosfwd.inc58  std/iostream.inc59  std/istream.inc60  std/iterator.inc61  std/latch.inc62  std/limits.inc63  std/list.inc64  std/locale.inc65  std/map.inc66  std/mdspan.inc67  std/memory.inc68  std/memory_resource.inc69  std/mutex.inc70  std/new.inc71  std/numbers.inc72  std/numeric.inc73  std/optional.inc74  std/ostream.inc75  std/print.inc76  std/queue.inc77  std/random.inc78  std/ranges.inc79  std/ratio.inc80  std/rcu.inc81  std/regex.inc82  std/scoped_allocator.inc83  std/semaphore.inc84  std/set.inc85  std/shared_mutex.inc86  std/source_location.inc87  std/span.inc88  std/spanstream.inc89  std/sstream.inc90  std/stack.inc91  std/stacktrace.inc92  std/stdexcept.inc93  std/stdfloat.inc94  std/stop_token.inc95  std/streambuf.inc96  std/string.inc97  std/string_view.inc98  std/strstream.inc99  std/syncstream.inc100  std/system_error.inc101  std/text_encoding.inc102  std/thread.inc103  std/tuple.inc104  std/type_traits.inc105  std/typeindex.inc106  std/typeinfo.inc107  std/unordered_map.inc108  std/unordered_set.inc109  std/utility.inc110  std/valarray.inc111  std/variant.inc112  std/vector.inc113  std/version.inc114)115 116set(LIBCXX_MODULE_STD_COMPAT_SOURCES117  std.compat/cassert.inc118  std.compat/cctype.inc119  std.compat/cerrno.inc120  std.compat/cfenv.inc121  std.compat/cfloat.inc122  std.compat/cinttypes.inc123  std.compat/climits.inc124  std.compat/clocale.inc125  std.compat/cmath.inc126  std.compat/csetjmp.inc127  std.compat/csignal.inc128  std.compat/cstdarg.inc129  std.compat/cstddef.inc130  std.compat/cstdint.inc131  std.compat/cstdio.inc132  std.compat/cstdlib.inc133  std.compat/cstring.inc134  std.compat/ctime.inc135  std.compat/cuchar.inc136  std.compat/cwchar.inc137  std.compat/cwctype.inc138)139 140# TODO MODULES the CMakeLists.txt in the build directory is only temporary.141# This allows using as available in the build directory. Once build systems142# have proper support for the installed files this will be removed.143if ("${LIBCXX_GENERATED_INCLUDE_DIR}" STREQUAL "${LIBCXX_GENERATED_INCLUDE_TARGET_DIR}")144  # This typically happens when the target is not installed.145  set(LIBCXX_CONFIGURED_INCLUDE_DIRS "${LIBCXX_GENERATED_INCLUDE_DIR}")146else()147  # It's important that the arch directory be included first so that its header files148  # which interpose on the default include dir be included instead of the default ones.149  set(LIBCXX_CONFIGURED_INCLUDE_DIRS150    "${LIBCXX_GENERATED_INCLUDE_TARGET_DIR};${LIBCXX_GENERATED_INCLUDE_DIR}"151  )152endif()153configure_file(154  "CMakeLists.txt.in"155  "${LIBCXX_GENERATED_MODULE_DIR}/CMakeLists.txt"156  @ONLY157)158 159set(LIBCXX_MODULE_STD_INCLUDE_SOURCES)160foreach(file ${LIBCXX_MODULE_STD_SOURCES})161  set(162    LIBCXX_MODULE_STD_INCLUDE_SOURCES163    "${LIBCXX_MODULE_STD_INCLUDE_SOURCES}#include \"${file}\"\n"164  )165endforeach()166 167configure_file(168  "std.cppm.in"169  "${LIBCXX_GENERATED_MODULE_DIR}/std.cppm"170  @ONLY171)172 173set(LIBCXX_MODULE_STD_COMPAT_INCLUDE_SOURCES)174foreach(file ${LIBCXX_MODULE_STD_COMPAT_SOURCES})175  set(176    LIBCXX_MODULE_STD_COMPAT_INCLUDE_SOURCES177    "${LIBCXX_MODULE_STD_COMPAT_INCLUDE_SOURCES}#include \"${file}\"\n"178  )179endforeach()180 181configure_file(182  "std.compat.cppm.in"183  "${LIBCXX_GENERATED_MODULE_DIR}/std.compat.cppm"184  @ONLY185)186 187set(_all_modules)188list(APPEND _all_modules "${LIBCXX_GENERATED_MODULE_DIR}/CMakeLists.txt")189list(APPEND _all_modules "${LIBCXX_GENERATED_MODULE_DIR}/std.cppm")190list(APPEND _all_modules "${LIBCXX_GENERATED_MODULE_DIR}/std.compat.cppm")191foreach(file ${LIBCXX_MODULE_STD_SOURCES} ${LIBCXX_MODULE_STD_COMPAT_SOURCES})192  set(src "${CMAKE_CURRENT_SOURCE_DIR}/${file}")193  set(dst "${LIBCXX_GENERATED_MODULE_DIR}/${file}")194  add_custom_command(OUTPUT ${dst}195    DEPENDS ${src}196    COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}197    COMMENT "Copying CXX module ${file}")198  list(APPEND _all_modules "${dst}")199endforeach()200 201add_custom_target(generate-cxx-modules202  ALL DEPENDS203    ${_all_modules}204)205 206# Configure the modules manifest.207# Use the relative path between the installation and the module in the json208# file. This allows moving the entire installation to a different location.209if("${CMAKE_INSTALL_PREFIX}" STREQUAL "")210  set(BASE_DIRECTORY "/")211else()212  set(BASE_DIRECTORY ${CMAKE_INSTALL_PREFIX})213endif()214cmake_path(ABSOLUTE_PATH LIBCXX_INSTALL_LIBRARY_DIR215  BASE_DIRECTORY ${BASE_DIRECTORY}216  OUTPUT_VARIABLE ABS_LIBRARY_DIR)217cmake_path(ABSOLUTE_PATH LIBCXX_INSTALL_MODULES_DIR218  BASE_DIRECTORY ${BASE_DIRECTORY}219  OUTPUT_VARIABLE ABS_MODULES_DIR)220file(RELATIVE_PATH LIBCXX_MODULE_RELATIVE_PATH221  ${ABS_LIBRARY_DIR}222  ${ABS_MODULES_DIR})223configure_file(224  "modules.json.in"225  "${LIBCXX_LIBRARY_DIR}/libc++.modules.json"226  @ONLY227)228 229# Dummy library to make modules an installation component.230add_library(cxx-modules INTERFACE)231add_dependencies(cxx-modules generate-cxx-modules)232 233if (LIBCXX_INSTALL_MODULES)234  foreach(file ${LIBCXX_MODULE_STD_SOURCES} ${LIBCXX_MODULE_STD_COMPAT_SOURCES})235    get_filename_component(dir ${file} DIRECTORY)236    install(FILES ${file}237      DESTINATION "${LIBCXX_INSTALL_MODULES_DIR}/${dir}"238      COMPONENT cxx-modules239      PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ240    )241  endforeach()242 243  # Install the generated module files.244  install(FILES245      "${LIBCXX_GENERATED_MODULE_DIR}/std.cppm"246      "${LIBCXX_GENERATED_MODULE_DIR}/std.compat.cppm"247    DESTINATION "${LIBCXX_INSTALL_MODULES_DIR}"248    COMPONENT cxx-modules249    PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ250  )251 252  # Install the module manifest.253  install(FILES254      "${LIBCXX_LIBRARY_DIR}/libc++.modules.json"255    DESTINATION "${LIBCXX_INSTALL_LIBRARY_DIR}"256    COMPONENT cxx-modules257    PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ258  )259 260  if (NOT CMAKE_CONFIGURATION_TYPES)261    add_custom_target(install-cxx-modules262                      DEPENDS cxx-modules263                      COMMAND "${CMAKE_COMMAND}"264                              -DCMAKE_INSTALL_COMPONENT=cxx-modules265                              -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")266    # Stripping is a no-op for modules267    add_custom_target(install-cxx-modules-stripped DEPENDS install-cxx-modules)268  endif()269endif()270