From e020e081646c3bcc46a761e0ca81d17d581fca0c Mon Sep 17 00:00:00 2001 From: Mark de Wever Date: Sat, 16 Dec 2023 18:05:56 +0100 Subject: [PATCH 1/3] [RFC][libc++] Install modules. The patch is based on the discussion in SG-15 on 12.12.2023. Fixes: https://github.com/llvm/llvm-project/issues/73089 --- libcxx/CMakeLists.txt | 6 +++ libcxx/cmake/caches/Generic-cxx26.cmake | 1 + .../Generic-hardening-mode-extensive.cmake | 1 + .../cmake/caches/Generic-no-exceptions.cmake | 1 + .../caches/Generic-no-experimental.cmake | 1 + .../cmake/caches/Generic-no-filesystem.cmake | 1 + .../caches/Generic-no-localization.cmake | 1 + .../caches/Generic-no-random_device.cmake | 1 + libcxx/cmake/caches/Generic-no-threads.cmake | 1 + libcxx/cmake/caches/Generic-no-unicode.cmake | 1 + .../caches/Generic-no-wide-characters.cmake | 1 + libcxx/docs/Modules.rst | 1 - libcxx/docs/ReleaseNotes/18.rst | 7 +++ libcxx/modules/CMakeLists.txt | 53 +++++++++++++++++++ libcxx/modules/modules.json.in | 26 +++++++++ libcxx/src/CMakeLists.txt | 3 ++ 16 files changed, 105 insertions(+), 1 deletion(-) create mode 100644 libcxx/modules/modules.json.in diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt index 53de53480266b0..cd1c73cf7d1171 100644 --- a/libcxx/CMakeLists.txt +++ b/libcxx/CMakeLists.txt @@ -178,6 +178,10 @@ set(LIBCXX_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}" CACHE STRING "Define suffix of library directory name (32/64)") option(LIBCXX_INSTALL_HEADERS "Install the libc++ headers." ON) option(LIBCXX_INSTALL_LIBRARY "Install the libc++ library." ON) +cmake_dependent_option(LIBCXX_INSTALL_MODULE_INTERFACE_UNIT_SOURCES + "Install the libc++ C++20 module interface unit source files (experimental)." OFF + "LIBCXX_ENABLE_STD_MODULES" OFF +) cmake_dependent_option(LIBCXX_INSTALL_STATIC_LIBRARY "Install the static libc++ library." ON "LIBCXX_ENABLE_STATIC;LIBCXX_INSTALL_LIBRARY" OFF) @@ -425,6 +429,8 @@ set(LIBCXX_INSTALL_INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/c++/v1" CACHE STRING "Path where target-agnostic libc++ headers should be installed.") set(LIBCXX_INSTALL_RUNTIME_DIR "${CMAKE_INSTALL_BINDIR}" CACHE STRING "Path where built libc++ runtime libraries should be installed.") +set(LIBCXX_INSTALL_MODULE_INTERFACE_UNIT_SOURCE_DIR "share/libc++/v1" CACHE STRING + "Path where target-agnostic libc++ module interface unit source should be installed.") set(LIBCXX_SHARED_OUTPUT_NAME "c++" CACHE STRING "Output name for the shared libc++ runtime library.") set(LIBCXX_STATIC_OUTPUT_NAME "c++" CACHE STRING "Output name for the static libc++ runtime library.") diff --git a/libcxx/cmake/caches/Generic-cxx26.cmake b/libcxx/cmake/caches/Generic-cxx26.cmake index 6ba9482af57851..2d9c018a4ff540 100644 --- a/libcxx/cmake/caches/Generic-cxx26.cmake +++ b/libcxx/cmake/caches/Generic-cxx26.cmake @@ -1,2 +1,3 @@ +set(LIBCXX_INSTALL_MODULES ON CACHE BOOL "") # TODO MODULES Remove when enabled automatically. set(LIBCXX_TEST_PARAMS "std=c++26" CACHE STRING "") set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "") diff --git a/libcxx/cmake/caches/Generic-hardening-mode-extensive.cmake b/libcxx/cmake/caches/Generic-hardening-mode-extensive.cmake index 72263dfd84635b..9542dcdbf77834 100644 --- a/libcxx/cmake/caches/Generic-hardening-mode-extensive.cmake +++ b/libcxx/cmake/caches/Generic-hardening-mode-extensive.cmake @@ -1 +1,2 @@ +set(LIBCXX_INSTALL_MODULES ON CACHE BOOL "") # TODO MODULES Remove when enabled automatically. set(LIBCXX_HARDENING_MODE "extensive" CACHE STRING "") diff --git a/libcxx/cmake/caches/Generic-no-exceptions.cmake b/libcxx/cmake/caches/Generic-no-exceptions.cmake index f0dffef60dba08..c68adfc1276b55 100644 --- a/libcxx/cmake/caches/Generic-no-exceptions.cmake +++ b/libcxx/cmake/caches/Generic-no-exceptions.cmake @@ -1,2 +1,3 @@ +set(LIBCXX_INSTALL_MODULES ON CACHE BOOL "") # TODO MODULES Remove when enabled automatically. set(LIBCXX_ENABLE_EXCEPTIONS OFF CACHE BOOL "") set(LIBCXXABI_ENABLE_EXCEPTIONS OFF CACHE BOOL "") diff --git a/libcxx/cmake/caches/Generic-no-experimental.cmake b/libcxx/cmake/caches/Generic-no-experimental.cmake index f33ed01418990b..62b7d7373d4478 100644 --- a/libcxx/cmake/caches/Generic-no-experimental.cmake +++ b/libcxx/cmake/caches/Generic-no-experimental.cmake @@ -1,2 +1,3 @@ +set(LIBCXX_INSTALL_MODULES ON CACHE BOOL "") # TODO MODULES Remove when enabled automatically. set(LIBCXX_TEST_PARAMS "enable_experimental=False" CACHE STRING "") set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "") diff --git a/libcxx/cmake/caches/Generic-no-filesystem.cmake b/libcxx/cmake/caches/Generic-no-filesystem.cmake index 4000f3a3e8ef23..01ae7e68f12c94 100644 --- a/libcxx/cmake/caches/Generic-no-filesystem.cmake +++ b/libcxx/cmake/caches/Generic-no-filesystem.cmake @@ -1 +1,2 @@ +set(LIBCXX_INSTALL_MODULES ON CACHE BOOL "") # TODO MODULES Remove when enabled automatically. set(LIBCXX_ENABLE_FILESYSTEM OFF CACHE BOOL "") diff --git a/libcxx/cmake/caches/Generic-no-localization.cmake b/libcxx/cmake/caches/Generic-no-localization.cmake index 79d6b44c7139aa..fc4957b2d53a71 100644 --- a/libcxx/cmake/caches/Generic-no-localization.cmake +++ b/libcxx/cmake/caches/Generic-no-localization.cmake @@ -1 +1,2 @@ +set(LIBCXX_INSTALL_MODULES ON CACHE BOOL "") # TODO MODULES Remove when enabled automatically. set(LIBCXX_ENABLE_LOCALIZATION OFF CACHE BOOL "") diff --git a/libcxx/cmake/caches/Generic-no-random_device.cmake b/libcxx/cmake/caches/Generic-no-random_device.cmake index e9b4cc60cc80ea..ddf479add6269c 100644 --- a/libcxx/cmake/caches/Generic-no-random_device.cmake +++ b/libcxx/cmake/caches/Generic-no-random_device.cmake @@ -1 +1,2 @@ +set(LIBCXX_INSTALL_MODULES ON CACHE BOOL "") # TODO MODULES Remove when enabled automatically. set(LIBCXX_ENABLE_RANDOM_DEVICE OFF CACHE BOOL "") diff --git a/libcxx/cmake/caches/Generic-no-threads.cmake b/libcxx/cmake/caches/Generic-no-threads.cmake index 616baef1be7bef..724fbc466b58a8 100644 --- a/libcxx/cmake/caches/Generic-no-threads.cmake +++ b/libcxx/cmake/caches/Generic-no-threads.cmake @@ -1,3 +1,4 @@ +set(LIBCXX_INSTALL_MODULES ON CACHE BOOL "") # TODO MODULES Remove when enabled automatically. set(LIBCXX_ENABLE_THREADS OFF CACHE BOOL "") set(LIBCXXABI_ENABLE_THREADS OFF CACHE BOOL "") set(LIBCXX_ENABLE_MONOTONIC_CLOCK OFF CACHE BOOL "") diff --git a/libcxx/cmake/caches/Generic-no-unicode.cmake b/libcxx/cmake/caches/Generic-no-unicode.cmake index 01160bf218981a..a4cf7dd73772b4 100644 --- a/libcxx/cmake/caches/Generic-no-unicode.cmake +++ b/libcxx/cmake/caches/Generic-no-unicode.cmake @@ -1 +1,2 @@ +set(LIBCXX_INSTALL_MODULES ON CACHE BOOL "") # TODO MODULES Remove when enabled automatically. set(LIBCXX_ENABLE_UNICODE OFF CACHE BOOL "") diff --git a/libcxx/cmake/caches/Generic-no-wide-characters.cmake b/libcxx/cmake/caches/Generic-no-wide-characters.cmake index 728d41086a3867..dc19389bb5ae21 100644 --- a/libcxx/cmake/caches/Generic-no-wide-characters.cmake +++ b/libcxx/cmake/caches/Generic-no-wide-characters.cmake @@ -1 +1,2 @@ +set(LIBCXX_INSTALL_MODULES ON CACHE BOOL "") # TODO MODULES Remove when enabled automatically. set(LIBCXX_ENABLE_WIDE_CHARACTERS OFF CACHE BOOL "") diff --git a/libcxx/docs/Modules.rst b/libcxx/docs/Modules.rst index 1998cd9d1d267e..a94189d5238277 100644 --- a/libcxx/docs/Modules.rst +++ b/libcxx/docs/Modules.rst @@ -69,7 +69,6 @@ Some of the current limitations * The path to the compiler may not be a symlink, ``clang-scan-deps`` does not handle that case properly * Libc++ is not tested with modules instead of headers - * The module ``.cppm`` files are not installed * Clang supports modules using GNU extensions, but libc++ does not work using GNU extensions. * Clang: diff --git a/libcxx/docs/ReleaseNotes/18.rst b/libcxx/docs/ReleaseNotes/18.rst index 77b7939a0c0ac9..5eb47221693229 100644 --- a/libcxx/docs/ReleaseNotes/18.rst +++ b/libcxx/docs/ReleaseNotes/18.rst @@ -93,6 +93,13 @@ Improvements and New Features infrastructure no longer depends on a modern CMake, it works with the minimal required LLVM version (3.20.0). +- The ``.cppm`` files of experimental standard library modules can now be + installed. By default, they are not installed. This can be enabled by + configuring CMake with ``-DLIBCXX_INSTALL_MODULES=ON``. The installation + directory can be configured with the CMake option + ``-DLIBCXX_INSTALL_MODULE_DIR=``. The default location is + ``share/libc++/v1`` in the same prefix as the ``include`` directory. + Deprecations and Removals ------------------------- diff --git a/libcxx/modules/CMakeLists.txt b/libcxx/modules/CMakeLists.txt index 31fbadf449f773..186a2f17a89e52 100644 --- a/libcxx/modules/CMakeLists.txt +++ b/libcxx/modules/CMakeLists.txt @@ -182,3 +182,56 @@ add_custom_target(generate-cxx-modules ALL DEPENDS ${_all_modules} ) + +# Use the relative path between the installation and the module in the json +# file. This allows moving the entire installation to a different location. +file(RELATIVE_PATH LIBCXX_MODULE_RELATIVE_PATH + ${CMAKE_INSTALL_PREFIX}/${LIBCXX_INSTALL_LIBRARY_DIR} + ${CMAKE_INSTALL_PREFIX}/${LIBCXX_INSTALL_MODULE_INTERFACE_UNIT_SOURCE_DIR}) +configure_file( + "modules.json.in" + "${LIBCXX_LIBRARY_DIR}/libc++.modules.json" + @ONLY +) + +# Dummy library to make modules an installation component. +add_library(cxx-modules INTERFACE) +add_dependencies(cxx-modules generate-cxx-modules) + +if (LIBCXX_INSTALL_MODULE_INTERFACE_UNIT_SOURCES) + foreach(file ${LIBCXX_MODULE_STD_SOURCES} ${LIBCXX_MODULE_STD_COMPAT_SOURCES}) + get_filename_component(dir ${file} DIRECTORY) + install(FILES ${file} + DESTINATION "${LIBCXX_INSTALL_MODULE_INTERFACE_UNIT_SOURCE_DIR}/${dir}" + COMPONENT cxx-modules + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + ) + endforeach() + + # Install the generated module files. + install(FILES + "${LIBCXX_GENERATED_MODULE_DIR}/std.cppm" + "${LIBCXX_GENERATED_MODULE_DIR}/std.compat.cppm" + DESTINATION "${LIBCXX_INSTALL_MODULE_INTERFACE_UNIT_SOURCE_DIR}" + COMPONENT cxx-modules + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + ) + + # Install the module manifest. + install(FILES + "${LIBCXX_LIBRARY_DIR}/libc++.modules.json" + DESTINATION "${LIBCXX_INSTALL_LIBRARY_DIR}" + COMPONENT cxx-modules + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + ) + + if (NOT CMAKE_CONFIGURATION_TYPES) + add_custom_target(install-cxx-modules + DEPENDS cxx-modules + COMMAND "${CMAKE_COMMAND}" + -DCMAKE_INSTALL_COMPONENT=cxx-modules + -P "${CMAKE_BINARY_DIR}/cmake_install.cmake") + # Stripping is a no-op for modules + add_custom_target(install-cxx-modules-stripped DEPENDS install-cxx-headers) + endif() +endif() diff --git a/libcxx/modules/modules.json.in b/libcxx/modules/modules.json.in new file mode 100644 index 00000000000000..ddc377f28f9194 --- /dev/null +++ b/libcxx/modules/modules.json.in @@ -0,0 +1,26 @@ +{ + "version": 1, + "revision": 1, + "modules": [ + { + "logical-name": "std", + "source-path": "@LIBCXX_MODULE_RELATIVE_PATH@/std.cppm", + "is-standard-library": true, + "local-arguments": { + "system-include-directories": [ + "@LIBCXX_MODULE_RELATIVE_PATH@" + ] + } + }, + { + "logical-name": "std.compat", + "source-path": "@LIBCXX_MODULE_RELATIVE_PATH@/std.compat.cppm", + "is-std-library": true, + "local-arguments": { + "system-include-directories": [ + "@LIBCXX_MODULE_RELATIVE_PATH@" + ] + } + } + ] +} diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt index dc2c98188aacce..a9edb98e1adba5 100644 --- a/libcxx/src/CMakeLists.txt +++ b/libcxx/src/CMakeLists.txt @@ -399,6 +399,9 @@ if (NOT CMAKE_CONFIGURATION_TYPES) if(LIBCXX_INSTALL_HEADERS) set(header_install_target install-cxx-headers) endif() + if(LIBCXX_INSTALL_MODULE_INTERFACE_UNIT_SOURCES) + set(header_install_target install-cxx-modules) + endif() add_custom_target(install-cxx DEPENDS ${lib_install_target} cxx_experimental From 26f262d7b6ce19c8643d0758848af264bd5dfe3c Mon Sep 17 00:00:00 2001 From: Mark de Wever Date: Thu, 18 Jan 2024 19:36:01 +0100 Subject: [PATCH 2/3] Address review comments. --- libcxx/cmake/caches/Generic-cxx20.cmake | 1 + libcxx/cmake/caches/Generic-cxx23.cmake | 1 + libcxx/docs/ReleaseNotes/18.rst | 2 +- libcxx/modules/CMakeLists.txt | 3 ++- libcxx/src/CMakeLists.txt | 4 +++- 5 files changed, 8 insertions(+), 3 deletions(-) diff --git a/libcxx/cmake/caches/Generic-cxx20.cmake b/libcxx/cmake/caches/Generic-cxx20.cmake index 3c44fdaf0e4253..641c131a737b18 100644 --- a/libcxx/cmake/caches/Generic-cxx20.cmake +++ b/libcxx/cmake/caches/Generic-cxx20.cmake @@ -1,2 +1,3 @@ +set(LIBCXX_INSTALL_MODULES ON CACHE BOOL "") # TODO MODULES Remove when enabled automatically. set(LIBCXX_TEST_PARAMS "std=c++20" CACHE STRING "") set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "") diff --git a/libcxx/cmake/caches/Generic-cxx23.cmake b/libcxx/cmake/caches/Generic-cxx23.cmake index bf88abf56ca6a4..f5409e4652e429 100644 --- a/libcxx/cmake/caches/Generic-cxx23.cmake +++ b/libcxx/cmake/caches/Generic-cxx23.cmake @@ -1,2 +1,3 @@ +set(LIBCXX_INSTALL_MODULES ON CACHE BOOL "") # TODO MODULES Remove when enabled automatically. set(LIBCXX_TEST_PARAMS "std=c++23" CACHE STRING "") set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "") diff --git a/libcxx/docs/ReleaseNotes/18.rst b/libcxx/docs/ReleaseNotes/18.rst index 5eb47221693229..1b04702f4ae6b0 100644 --- a/libcxx/docs/ReleaseNotes/18.rst +++ b/libcxx/docs/ReleaseNotes/18.rst @@ -98,7 +98,7 @@ Improvements and New Features configuring CMake with ``-DLIBCXX_INSTALL_MODULES=ON``. The installation directory can be configured with the CMake option ``-DLIBCXX_INSTALL_MODULE_DIR=``. The default location is - ``share/libc++/v1`` in the same prefix as the ``include`` directory. + ``${PREFIX}/share/libc++/v1``. Deprecations and Removals diff --git a/libcxx/modules/CMakeLists.txt b/libcxx/modules/CMakeLists.txt index 186a2f17a89e52..9b9e670d73d81c 100644 --- a/libcxx/modules/CMakeLists.txt +++ b/libcxx/modules/CMakeLists.txt @@ -183,6 +183,7 @@ add_custom_target(generate-cxx-modules ${_all_modules} ) +# Configure the modules manifest. # Use the relative path between the installation and the module in the json # file. This allows moving the entire installation to a different location. file(RELATIVE_PATH LIBCXX_MODULE_RELATIVE_PATH @@ -232,6 +233,6 @@ if (LIBCXX_INSTALL_MODULE_INTERFACE_UNIT_SOURCES) -DCMAKE_INSTALL_COMPONENT=cxx-modules -P "${CMAKE_BINARY_DIR}/cmake_install.cmake") # Stripping is a no-op for modules - add_custom_target(install-cxx-modules-stripped DEPENDS install-cxx-headers) + add_custom_target(install-cxx-modules-stripped DEPENDS install-cxx-modules) endif() endif() diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt index a9edb98e1adba5..ff65c2a26124b3 100644 --- a/libcxx/src/CMakeLists.txt +++ b/libcxx/src/CMakeLists.txt @@ -400,12 +400,13 @@ if (NOT CMAKE_CONFIGURATION_TYPES) set(header_install_target install-cxx-headers) endif() if(LIBCXX_INSTALL_MODULE_INTERFACE_UNIT_SOURCES) - set(header_install_target install-cxx-modules) + set(module_install_target install-cxx-modules) endif() add_custom_target(install-cxx DEPENDS ${lib_install_target} cxx_experimental ${header_install_target} + ${module_install_target} COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=cxx -P "${LIBCXX_BINARY_DIR}/cmake_install.cmake") @@ -413,6 +414,7 @@ if (NOT CMAKE_CONFIGURATION_TYPES) DEPENDS ${lib_install_target} cxx_experimental ${header_install_target} + ${module_install_target} COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=cxx -DCMAKE_INSTALL_DO_STRIP=1 From 962051935c461934b58ed390bab48d365abfa4a3 Mon Sep 17 00:00:00 2001 From: Mark de Wever Date: Thu, 18 Jan 2024 19:41:54 +0100 Subject: [PATCH 3/3] Addresses more review comments. --- libcxx/CMakeLists.txt | 9 ++++----- libcxx/modules/CMakeLists.txt | 8 ++++---- libcxx/src/CMakeLists.txt | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt index cd1c73cf7d1171..d392e95077ac57 100644 --- a/libcxx/CMakeLists.txt +++ b/libcxx/CMakeLists.txt @@ -178,9 +178,8 @@ set(LIBCXX_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}" CACHE STRING "Define suffix of library directory name (32/64)") option(LIBCXX_INSTALL_HEADERS "Install the libc++ headers." ON) option(LIBCXX_INSTALL_LIBRARY "Install the libc++ library." ON) -cmake_dependent_option(LIBCXX_INSTALL_MODULE_INTERFACE_UNIT_SOURCES - "Install the libc++ C++20 module interface unit source files (experimental)." OFF - "LIBCXX_ENABLE_STD_MODULES" OFF +option(LIBCXX_INSTALL_MODULES + "Install the libc++ C++20 module source files (experimental)." OFF ) cmake_dependent_option(LIBCXX_INSTALL_STATIC_LIBRARY "Install the static libc++ library." ON @@ -429,8 +428,8 @@ set(LIBCXX_INSTALL_INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/c++/v1" CACHE STRING "Path where target-agnostic libc++ headers should be installed.") set(LIBCXX_INSTALL_RUNTIME_DIR "${CMAKE_INSTALL_BINDIR}" CACHE STRING "Path where built libc++ runtime libraries should be installed.") -set(LIBCXX_INSTALL_MODULE_INTERFACE_UNIT_SOURCE_DIR "share/libc++/v1" CACHE STRING - "Path where target-agnostic libc++ module interface unit source should be installed.") +set(LIBCXX_INSTALL_MODULES_DIR "share/libc++/v1" CACHE STRING + "Path where target-agnostic libc++ module source files should be installed.") set(LIBCXX_SHARED_OUTPUT_NAME "c++" CACHE STRING "Output name for the shared libc++ runtime library.") set(LIBCXX_STATIC_OUTPUT_NAME "c++" CACHE STRING "Output name for the static libc++ runtime library.") diff --git a/libcxx/modules/CMakeLists.txt b/libcxx/modules/CMakeLists.txt index 9b9e670d73d81c..0388c048dacb8b 100644 --- a/libcxx/modules/CMakeLists.txt +++ b/libcxx/modules/CMakeLists.txt @@ -188,7 +188,7 @@ add_custom_target(generate-cxx-modules # file. This allows moving the entire installation to a different location. file(RELATIVE_PATH LIBCXX_MODULE_RELATIVE_PATH ${CMAKE_INSTALL_PREFIX}/${LIBCXX_INSTALL_LIBRARY_DIR} - ${CMAKE_INSTALL_PREFIX}/${LIBCXX_INSTALL_MODULE_INTERFACE_UNIT_SOURCE_DIR}) + ${CMAKE_INSTALL_PREFIX}/${LIBCXX_INSTALL_MODULES_DIR}) configure_file( "modules.json.in" "${LIBCXX_LIBRARY_DIR}/libc++.modules.json" @@ -199,11 +199,11 @@ configure_file( add_library(cxx-modules INTERFACE) add_dependencies(cxx-modules generate-cxx-modules) -if (LIBCXX_INSTALL_MODULE_INTERFACE_UNIT_SOURCES) +if (LIBCXX_INSTALL_MODULES) foreach(file ${LIBCXX_MODULE_STD_SOURCES} ${LIBCXX_MODULE_STD_COMPAT_SOURCES}) get_filename_component(dir ${file} DIRECTORY) install(FILES ${file} - DESTINATION "${LIBCXX_INSTALL_MODULE_INTERFACE_UNIT_SOURCE_DIR}/${dir}" + DESTINATION "${LIBCXX_INSTALL_MODULES_DIR}/${dir}" COMPONENT cxx-modules PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ ) @@ -213,7 +213,7 @@ if (LIBCXX_INSTALL_MODULE_INTERFACE_UNIT_SOURCES) install(FILES "${LIBCXX_GENERATED_MODULE_DIR}/std.cppm" "${LIBCXX_GENERATED_MODULE_DIR}/std.compat.cppm" - DESTINATION "${LIBCXX_INSTALL_MODULE_INTERFACE_UNIT_SOURCE_DIR}" + DESTINATION "${LIBCXX_INSTALL_MODULES_DIR}" COMPONENT cxx-modules PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ ) diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt index ff65c2a26124b3..5481fe440e7815 100644 --- a/libcxx/src/CMakeLists.txt +++ b/libcxx/src/CMakeLists.txt @@ -399,7 +399,7 @@ if (NOT CMAKE_CONFIGURATION_TYPES) if(LIBCXX_INSTALL_HEADERS) set(header_install_target install-cxx-headers) endif() - if(LIBCXX_INSTALL_MODULE_INTERFACE_UNIT_SOURCES) + if(LIBCXX_INSTALL_MODULES) set(module_install_target install-cxx-modules) endif() add_custom_target(install-cxx