Skip to content

Conversation

jmschonfeld
Copy link
Contributor

When building this package locally via CMake using a toolchain that contains the _FoundationCShims module, you currently encounter errors like:

/usr/lib/swift/_FoundationCShims/module.modulemap:1:8: error: redefinition of module '_FoundationCShims'
1 | module _FoundationCShims {
  |        `- error: redefinition of module '_FoundationCShims'
2 |     header "_FoundationCShims.h"
3 | 

/Repos/Public/swift-foundation/Sources/_FoundationCShims/include/module.modulemap:1:8: note: previously defined here
1 | module _FoundationCShims {
  |        `- note: previously defined here
2 |     header "_FoundationCShims.h"
3 | 

To solve this, we add an explicit -fmodule-map-file flag to swift clients which causes clang to prefer the local module over the module from the SDK. SwiftPM already applies this flag which is how the SwiftPM build works today.

@jmschonfeld
Copy link
Contributor Author

@swift-ci please test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants