Skip to content

Commit 83b23c0

Browse files
Teemperorvgvassilev
authored andcommitted
[cxxmodules] Also install the overlay file and modulemaps
ROOT needs an overlay files in the include directory during runtime to correctly mount the system modulemaps for libc/STL. For this we need to generate and install a new overlay file that points to the *installed* modulemaps for those libraries. We can't use the existing modulemap as this one still points to the original build directory. We also need to install the related stl/lib modulemaps.
1 parent 00b892a commit 83b23c0

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,14 @@ if (NOT WIN32 AND NOT libcxx)
241241
list(GET __libcpp_full_paths_list 0 __libcpp_full_path)
242242

243243
configure_file(${CMAKE_SOURCE_DIR}/build/unix/modulemap.overlay.yaml.in ${CMAKE_BINARY_DIR}/include/modulemap.overlay.yaml @ONLY)
244+
configure_file(${CMAKE_SOURCE_DIR}/build/unix/modulemap-installed.overlay.yaml.in ${CMAKE_BINARY_DIR}/build/modulemap.overlay.yaml @ONLY)
245+
install(FILES "${CMAKE_BINARY_DIR}/build/modulemap.overlay.yaml" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT headers)
244246

245247
configure_file(${CMAKE_SOURCE_DIR}/build/unix/stl.modulemap ${CMAKE_BINARY_DIR}/include/stl.modulemap)
248+
install(FILES "${CMAKE_BINARY_DIR}/include/stl.modulemap" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT headers)
246249
configure_file(${CMAKE_SOURCE_DIR}/build/unix/libc.modulemap ${CMAKE_BINARY_DIR}/include/libc.modulemap)
250+
install(FILES "${CMAKE_BINARY_DIR}/include/libc.modulemap" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT headers)
251+
247252
else()
248253
message(SEND_ERROR "Couldn't find c++ library paths, no modulemap overlay will be installed! (__libcpp_full_paths = '${__libcpp_full_paths}')")
249254
endif()
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
'version': 0,
3+
'roots': [
4+
{ 'name': '@__libcpp_full_path@', 'type': 'directory',
5+
'contents': [
6+
{ 'name': 'module.modulemap', 'type': 'file',
7+
'external-contents': '@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@/stl.modulemap'
8+
}
9+
]
10+
},
11+
{ 'name': '/usr/include/', 'type': 'directory',
12+
'contents': [
13+
{ 'name': 'module.modulemap', 'type': 'file',
14+
'external-contents': '@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@/libc.modulemap'
15+
}
16+
]
17+
}
18+
]
19+
}

0 commit comments

Comments
 (0)