From dd95cf1d373bd36aca64ac297d1d54d422661e9b Mon Sep 17 00:00:00 2001 From: Evan Wilde Date: Thu, 9 Oct 2025 13:53:57 -0700 Subject: [PATCH] CMake: modulemap override in build interface 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. --- Sources/_FoundationCShims/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/_FoundationCShims/CMakeLists.txt b/Sources/_FoundationCShims/CMakeLists.txt index 1798a5bb0..d8e5d06a7 100644 --- a/Sources/_FoundationCShims/CMakeLists.txt +++ b/Sources/_FoundationCShims/CMakeLists.txt @@ -20,7 +20,7 @@ add_library(_FoundationCShims STATIC target_include_directories(_FoundationCShims PUBLIC include) target_compile_options(_FoundationCShims INTERFACE - "$<$:SHELL:-Xcc -fmodule-map-file=${CMAKE_CURRENT_SOURCE_DIR}/include/module.modulemap>") + "$:SHELL:-Xcc -fmodule-map-file=${CMAKE_CURRENT_SOURCE_DIR}/include/module.modulemap>>") set_property(GLOBAL APPEND PROPERTY SWIFT_FOUNDATION_EXPORTS _FoundationCShims)