Skip to content

Commit 59c6a46

Browse files
authored
CMake: modulemap override in build interface (#1539)
The modulemap override should only be added in the build interface, where we don't copy the modulemap and header files. The install interface installs the modulemap and header files to a location where the compiler will see it, so passing the override results in the compiler seeing both modulemaps defining the same module and then failing. This moves the override to only be part of the build interface.
1 parent 77f9c33 commit 59c6a46

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/_FoundationCShims/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ add_library(_FoundationCShims STATIC
2020
target_include_directories(_FoundationCShims PUBLIC include)
2121

2222
target_compile_options(_FoundationCShims INTERFACE
23-
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xcc -fmodule-map-file=${CMAKE_CURRENT_SOURCE_DIR}/include/module.modulemap>")
23+
"$<BUILD_INTERFACE:$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xcc -fmodule-map-file=${CMAKE_CURRENT_SOURCE_DIR}/include/module.modulemap>>")
2424

2525
set_property(GLOBAL APPEND PROPERTY SWIFT_FOUNDATION_EXPORTS _FoundationCShims)
2626

0 commit comments

Comments
 (0)