Skip to content

Commit 1abeefb

Browse files
committed
build: create modulemap symlinks
Use a darwin specific modulemap on darwin, and the generic one elsewhere. This fixes the cmake build to create the symlinks like the autotools build and cause the installation to be correct on Darwin as well as the build.
1 parent b791d23 commit 1abeefb

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

CMakeLists.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,23 @@ if(leaks_EXECUTABLE)
188188
set(HAVE_LEAKS TRUE)
189189
endif()
190190

191+
if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
192+
add_custom_command(OUTPUT
193+
"${CMAKE_SOURCE_DIR}/dispatch/module.modulemap"
194+
"${CMAKE_SOURCE_DIR}/private/module.modulemap"
195+
COMMAND
196+
${CMAKE_COMMAND} -E create_symlink "${CMAKE_SOURCE_DIR}/darwin/module.modulemap" "${CMAKE_SOURCE_DIR}/dispatch/module.modulemap"
197+
COMMAND
198+
${CMAKE_COMMAND} -E create_symlink "${CMAKE_SOURCE_DIR}/darwin/module.modulemap" "${CMAKE_SOURCE_DIR}/private/module.modulemap")
199+
else()
200+
add_custom_command(OUTPUT
201+
"${CMAKE_SOURCE_DIR}/dispatch/module.modulemap"
202+
"${CMAKE_SOURCE_DIR}/private/module.modulemap"
203+
COMMAND
204+
${CMAKE_COMMAND} -E create_symlink "${CMAKE_SOURCE_DIR}/generic/module.modulemap" "${CMAKE_SOURCE_DIR}/dispatch/module.modulemap"
205+
COMMAND
206+
${CMAKE_COMMAND} -E create_symlink "${CMAKE_SOURCE_DIR}/generic/module.modulemap" "${CMAKE_SOURCE_DIR}/private/module.modulemap")
207+
endif()
191208
configure_file("${CMAKE_SOURCE_DIR}/cmake/config.h.in"
192209
"${CMAKE_BINARY_DIR}/config/config_ac.h")
193210
add_definitions(-DHAVE_CONFIG_H)

0 commit comments

Comments
 (0)