-
Notifications
You must be signed in to change notification settings - Fork 128
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
gracefully handling of CC/CXX change #97
Comments
Do you mean you're running The |
I always run
Not sure what you mean, let me rephase problem again.
User build it via
All recompiled fine, but in fact resulted If represent problem as sequence of shell commands: $ CC=gcc CXX=g++ cargo build
$ grep DISABLE_LTO_BUILD target/debug/build/foo-sys-e0d8523e5679fc5c/out/build/CMakeCache.txt
DISABLE_LTO_BUILD:BOOL=True
$ CC=clang CXX=clang++ cargo build
$ grep DISABLE_LTO_BUILD target/debug/build/foo-sys-e0d8523e5679fc5c/out/build/CMakeCache.txt
DISABLE_LTO_BUILD:BOOL=False as you see Alternatively you can run |
I have been recently hit by this issue. This issue is especially annoying in the cross compilation situation, as targets (and thus toolchain files) may change at any time. In the worst case, the cmake build itself finishes but artifacts are located in wrong locations so the final linkage step will fail, and the only reasonable remedy would be To my knowledge this is an explicit design decision from CMake's part (which I strongly disagrees), and any users of
Future versions of |
I use something like this in my
build.rs
:all fine, until user changed CC/CXX environment variable and force rebuild with already
cached cmake build,
then:
and all my settings is gone, like
DISABLE_LTO_BUILD
,MAINTAINER_MODE
etc.Can
cmake-rs
detect if CC/CXX changed and reruncmake
twice? So on the second time it get proper values of variables?The text was updated successfully, but these errors were encountered: