Kobzol / cargo-pgo

Cargo subcommand for optimizing Rust binaries/libraries with PGO and BOLT.
MIT License
573 stars 11 forks source link

Add a CLI flag to swap between setting build/target rustflags #58

Open Kobzol opened 4 months ago

Kobzol commented 4 months ago

cargo-pgo currently sets PGO rustflags through target.*.rustflags from Rust 1.63+ (since https://github.com/Kobzol/cargo-pgo/pull/57, see https://github.com/Kobzol/cargo-pgo/issues/56 for the reasoning). This means that if you have e.g. build.rustflags in your Cargo config file, it will be overridden by the flags set by cargo-pgo.

It might be useful to some users to give them the option to decide whether they want to use the target or the build rustflags. The latter might be useful if the user already has some build.rustflags value set and they do not want to override them.

This was suggested here.