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

Infer CMAKE_BUILD_TYPE from DEBUG enviroment variable #23

Open
DavidEichmann opened this issue Feb 5, 2017 · 2 comments
Open

Infer CMAKE_BUILD_TYPE from DEBUG enviroment variable #23

DavidEichmann opened this issue Feb 5, 2017 · 2 comments

Comments

@DavidEichmann
Copy link

I'm relatively new to cmake and to custom rust/cargo build scripts so, correct me if I am wrong. Currently this library doesn't observe the DEBUG environment variable. It may be useful to do this in order support release/debug builds via cargo. I'm suggesting that if DEBUG="true" then set CMAKE_BUILD_TYPE="Debug" else if DEBUG="false" set CMAKE_BUILD_TYPE="Release" else don't set CMAKE_BUILD_TYPE.

@alexcrichton
Copy link
Member

Ah yeah so right now we infer debug/release based on cargo build vs cargo build --release, but adding and explicit env var seems reasonable to!

@lilianmoraru
Copy link

Since "DEBUG"(the environment variable) is not a common and standardized variable for these situations, I think cmake(the crate) should not treat it in a special way.
It's not hard as a user to do env!("DEBUG")/option_env!("DEBUG") and then treat that however you want, after which to call cmake_config.profile("[what the user wants]").

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

No branches or pull requests

3 participants