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 default language version through variable #937

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wdhongtw
Copy link

Use CMake reserved variable to specify default C++ language version,
so version can be adjust later by each target accordingly.

Recently I noticed that we can not change the C++ language version for targets
through target_compile_features. It turns out that setting language version
with add_definitions is incompatible with target_compile_features, as
the definition flags got propagated to actual command unconditionally.

This PR try to set the language version in a way that CMake awares.

see also:

Use CMake reserved variable to specify default C++ language version,
so version can be adjust later by each target accordingly.
@wdhongtw
Copy link
Author

I also would like to replace other usage of add_definitions with
add_compile_definitions and add_compile_options, but that require we
increase the minimal CMake version form 3.5 to 3.12.

If what's a acceptable, please let me known. Maybe I can enhance these together. :D

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

Successfully merging this pull request may close these issues.

1 participant