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

Can I pass additional flags when building benchmark? #246

Open
kkebo opened this issue May 3, 2024 · 4 comments
Open

Can I pass additional flags when building benchmark? #246

kkebo opened this issue May 3, 2024 · 4 comments

Comments

@kkebo
Copy link
Contributor

kkebo commented May 3, 2024

I often use LTO with swift bulid --experimental-lto-mode=full -Xswiftc -experimental-hermetic-seal-at-link.

Can I pass these flags to swift-build when running swift package benchmark? If so, how do I do?

@hassila
Copy link
Contributor

hassila commented May 4, 2024

I think just adding them to your binary target in Package.swift should do what you want - did you try it?

@kkebo
Copy link
Contributor Author

kkebo commented May 4, 2024

I think just adding them to your binary target in Package.swift should do what you want - did you try it?

Only the swiftc flags can be passed in Package.swift, not the swift-build flags.

@kkebo
Copy link
Contributor Author

kkebo commented May 4, 2024

To illustrate with the example given in my first comment, -experimental-hermetic-seal-at-link is a flag of swiftc and --experimental-lto-mode=full is a flag of swift-build.

@hassila
Copy link
Contributor

hassila commented May 4, 2024

Ah. Good question, will need to investigate if there's support in the swiftpm api for specifying this for builds, as that's what we're using to build the targets...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants