Detect LTO setting in build script

Is it possible to detect whether the current cargo profile has lto=true or not?

I have a workspace that has:

[profile.release]
lto = true

I can see that the output of the compilation with -vvv includes -C lto, but CARGO_ENCODED_RUSTFLAGS when printed from the buildscript never contains anything indicating lto. There seems to be previous suggestions that it should show up in that env var, but that doesnt seem to be true currently. Any ideas?

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.