[libc++] Fix installation path for the modulemap
authorLouis Dionne <ldionne.2@gmail.com>
Mon, 23 Jan 2023 15:19:27 +0000 (10:19 -0500)
committerLouis Dionne <ldionne.2@gmail.com>
Tue, 24 Jan 2023 01:12:26 +0000 (20:12 -0500)
As pointed out in a post-commit comment of https://reviews.llvm.org/rGd00e035a4270.

Differential Revision: https://reviews.llvm.org/D142365

libcxx/include/CMakeLists.txt

index 5d4fa91..51bfc8c 100644 (file)
@@ -909,13 +909,18 @@ if (LIBCXX_INSTALL_HEADERS)
     )
   endforeach()
 
-  # Install the generated __config_site and the generated modulemap file.
+  # Install the generated __config_site file to the per-target include dir.
   install(FILES "${LIBCXX_GENERATED_INCLUDE_TARGET_DIR}/__config_site"
-                "${LIBCXX_GENERATED_INCLUDE_DIR}/module.modulemap"
     DESTINATION "${LIBCXX_INSTALL_INCLUDE_TARGET_DIR}"
     PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
     COMPONENT cxx-headers)
 
+  # Install the generated modulemap file to the generic include dir.
+  install(FILES "${LIBCXX_GENERATED_INCLUDE_DIR}/module.modulemap"
+    DESTINATION "${LIBCXX_INSTALL_INCLUDE_DIR}"
+    PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
+    COMPONENT cxx-headers)
+
   if (NOT CMAKE_CONFIGURATION_TYPES)
     add_custom_target(install-cxx-headers
                       DEPENDS cxx-headers