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-4710] swift build -Xswiftc has to be repeated #5031
Comments
The current behavior is correct. (Otherwise all of the -Xswiftc arguments would have to go at the end, and there is more than one -X option that you might want to pass.) |
Comment by Amr Aboelela (JIRA) But there got to be a better solution, because imagine I want to add: -emit-library -o libSwiftLevelDB.so |
-Xswiftc is a hack to make up for not having build settings. You certainly shouldn't use it to control things like -emit-library or -o; it'll confuse the package manager. |
Comment by Amr Aboelela (JIRA) Well I tried it and it works 🙂 |
You tried it and it builds. What are you actually trying to do? (and, tagging in @aciidb0mb3r, who knows a lot more about the package manager and swift-build than I do.) |
@belkadan is right, -Xswiftc is a hack until we get build settings. The arguments are passed directly to all the packages in the graph. Do not rely on this to create things like libraries. See SE-0146 if you want to create a library product. It is implemented in trunk so you can grab a trunk toolchain from swift.org to try it out. (Also see SE-0158 for Swift 4 manifest syntax). |
Comment by Amr Aboelela (JIRA) Ok, got it. |
Additional Detail from JIRA
md5: a1bed3d79d6ff2f91a9a87e01788e725
cloned to:
Issue Description:
To pass 2 items to swiftc compiler currently we need to repeat -Xswiftc for each item, e.g.:
swift build -Xswiftc -DDEBUG -Xswiftc -DAppServer
Expected behavior is to use -Xswiftc only once, like:
swift build -Xswiftc -DDEBUG -DAppServer
The text was updated successfully, but these errors were encountered: