-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Fix use of extraCPPFlags
#5793
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
Fix use of extraCPPFlags
#5793
Conversation
@swift-ci please smoke test |
Looks like we have some tests asserting the broken behavior since |
a47085c
to
c4eeb98
Compare
Wouldn't we need |
Yah, looks like it, the question is why are we even passing |
Yes, that seems more correct. Compilation flags and linking flags should generally be separate. There might be some leniency in that compiler drivers might accept and ignore a linker flag if only doing compilation, but it would better to not rely on that (also less confusing for users who are looking at build logs). |
I guess that would mean to also have per-language linker flags in the destination, because otherwise we won't be able to make |
We should not use `extraCPPFlags` as a vehicle for specifying linker flags, instead just decide on which C++ library to link based on the target triple in `BuildPlan`. Separately, it seems worthwhile to look into refactoring `Destination` to actually allow specifying linker flags since that seems to have been an accidental feature of `extraCPPFlags` (as long as one didn't pass compiler flags there as well). rdar://100575898
c4eeb98
to
236834a
Compare
Updated to move the code for deciding on C++ library linkage, but I think we should be revisiting |
@swift-ci please smoke test |
That seems reasonable. Separately, it seems to me that we should also factor out all of these platform specifics into separate protocol-conforming entities that provide the specifics. Maybe that is what you were saying about the Destination. But that, too, is something that can be done in the future. This change looks good for what it is. |
We should not use
extraCPPFlags
as a vehicle for specifying linker flags, instead just decide on which C++ library to link based on the target triple inBuildPlan
.rdar://100575898