Skip to content

Commit 7c2432a

Browse files
committed
CMake: modulemap file override as build interface
We should only be pulling in the modulemap file from the source directory when compiling against the build directory, not the installed location. The module-map-file override should only be applied as part of the build interface, not install interface. In cases where the sources are checked out and we are compiling a project against the install interface, we will run into a situation where the compiler sees the modulemap from both the installed location and the source directory and will complain.
1 parent 2113033 commit 7c2432a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

icuSources/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ target_include_directories(_FoundationICU
1919
include/)
2020

2121
target_compile_options(_FoundationICU INTERFACE
22-
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xcc -fmodule-map-file=${CMAKE_CURRENT_SOURCE_DIR}/include/_foundation_unicode/module.modulemap>")
22+
"$<BUILD_INTERFACE:$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xcc -fmodule-map-file=${CMAKE_CURRENT_SOURCE_DIR}/include/_foundation_unicode/module.modulemap>>")
2323

2424
add_subdirectory(common)
2525
add_subdirectory(i18n)

0 commit comments

Comments
 (0)