Running swift build
on this project succeeds, while building after generating and opening the Xcode project fails with:
Use of '@import' when modules are disabled
- Xcode 12.0 (12A7208)
- Swift 5.3
- Run
swift package generate-xcodeproj
- Run
open Example.xcodeproj
- Select
Mac
in the simulator dropdown - Build Xcode project
I've tried creating an Settings.xcconfig with the following iterations:
DEFINES_MODULE = YES;
CLANG_MODULES_AUTOLINK = YES;
CLANG_ENABLE_MODULES = YES;
And then running swift package generate-xcodeproj --xcconfig-overrides Settings.xcconfig
.
This has not worked.
This PR exemplifies how to fix this problem