Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-7531] SwiftPM doesn't set CLANG_ENABLE_MODULES #4821

Closed
weissi opened this issue Apr 25, 2018 · 6 comments
Closed

[SR-7531] SwiftPM doesn't set CLANG_ENABLE_MODULES #4821

weissi opened this issue Apr 25, 2018 · 6 comments
Labels

Comments

@weissi
Copy link
Member

weissi commented Apr 25, 2018

Previous ID SR-7531
Radar rdar://problem/38377596
Original Reporter @weissi
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Package Manager
Labels Bug
Assignee None
Priority Medium

md5: 574f6b259a817031abad9384f47f1494

is duplicated by:

  • SR-8629 Wrong compiler and missing use modules flag for C/ObjC dependency in stephencelis/SQLite.swift when using generated Xcode project

Issue Description:

When generating Xcode projects using SwiftPM, the "Enable Modules (C and Objective-C projects)" is set to "No" but it should be set to "Yes".

With projects depending on SwiftNIO that often causes CAtomics not to be compiled.

Workaround:

  • set CLANG_ENABLE_MODULES=YES in an .xcconfig

  • set "Enable Modules (C and Objective-C projects)" to Yes for the project

@AnnaZaks
Copy link
Mannequin

AnnaZaks mannequin commented May 1, 2018

cc @aciidb0mb3r

@ankitspd
Copy link
Member

ankitspd commented May 1, 2018

IIRC we explicitly keep it off for complex indexing related reasons. See:

#1422

@weissi
Copy link
Member Author

weissi commented May 1, 2018

@aciidb0mb3r but isn't not having completion much better than not compiling? Do we have a radar for the completion not working?

@ankitspd
Copy link
Member

ankitspd commented May 1, 2018

I don't think we had bugs about not being able to compile with modules was turned off. I see you mentioned having this issue with CAtomics, would be nice if you can include complete reproduction steps. IIRC, it wasn't really a bug with indexing, its just that the SwiftPM's project model doesn't map 1-to-1 with the generated Xcode project. I think #1406 is a good compromise but we need to test it with some community packages to make sure it doesn't break something unexpected.

@ankitspd
Copy link
Member

I landed an enhancement where modules will be enabled when there is an umbrella header in the C target. 7f27fcf

@weissi
Copy link
Member Author

weissi commented Oct 17, 2018

@aciidb0mb3r sorry, I didn't get a notification about your comments. See complete repro instructions in SR-9024 . Or just try adding SwiftNIO as a sub-project to any Xcode proj you created yourself. See also: https://forums.swift.org/t/cant-experiment-swiftnio-in-playground/15020

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants