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