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

set_compiler_flag confusing #510

Open
JVApen opened this issue Mar 31, 2019 · 2 comments
Open

set_compiler_flag confusing #510

JVApen opened this issue Mar 31, 2019 · 2 comments

Comments

@JVApen
Copy link

JVApen commented Mar 31, 2019

Reading through the book, the function set_compiler_flag doesn't result in the expected behavior.

Expected Behavior

After calling set_compiler_flag, I would expect that compiler flag to be set.

Current Behavior

The function sets a status variable to indicate that the flag is valid.

Possible Solution

Rename to check_compiler_flag or find_valid_compiler_flag

@bast
Copy link
Member

bast commented Apr 8, 2019

Thank you for reporting! I will try to reproduce this.

@bast
Copy link
Member

bast commented Apr 8, 2019

And I believe you mean this example:
https://github.com/dev-cafe/cmake-cookbook/blob/master/chapter-07/recipe-03/c-cxx-example/set_compiler_flag.cmake

Which indeed sets a variable but does not modify global compiler flag variables since we wanted to give the caller the flexibility to set them per-target or project-wide.

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

2 participants