Skip to content

Commit c2d0c49

Browse files
authored
Merge pull request #261 from compnerd/module-maps
build: switch the module map according to the target
2 parents b791d23 + 1abeefb commit c2d0c49

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)