Skip to content

Some C++ packages fail to build on Apple platforms #7267

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

Merged
merged 1 commit into from
Jan 18, 2024
Merged

Some C++ packages fail to build on Apple platforms #7267

merged 1 commit into from
Jan 18, 2024

Conversation

ian-twilightcoder
Copy link
Contributor

Disable clang modules for C++ compilation on Apple platforms

Motivation:

I didn't realize that there were some circumstances where passing -fmodules would enable clang modules for C++ on Apple platforms.

Modifications:

Go back to not passing -fmodules for Apple platforms.

Result:

C++ packages should be able to build properly again.

`-fmodules` doesn't usually do anything in Apple clang for C++ compilation, `-fcxx-modules` needs to be passed as well. However, pure C++ (not Objective-C++) and a new enough dialect on some versions of Apple clang will implicitly enable `-fcxx-modules`, enabling clang modules, and causing errors. Stop passing `-fmodules` for C++ compilation.

rdar://121056905
@ian-twilightcoder
Copy link
Contributor Author

@swift-ci test

@ian-twilightcoder
Copy link
Contributor Author

@swift-ci smoke test

@stmontgomery
Copy link
Contributor

Related to #7241

@ian-twilightcoder ian-twilightcoder enabled auto-merge (squash) January 17, 2024 23:23
@ian-twilightcoder ian-twilightcoder merged commit 24bfdd1 into swiftlang:main Jan 18, 2024
@ian-twilightcoder ian-twilightcoder deleted the no-darwin-cxx-modules branch January 18, 2024 01:00
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