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

FMT_USE_CPP11 option pollutes build flags with '-std=c++11' #366

Closed
wants to merge 1 commit into from
Closed

FMT_USE_CPP11 option pollutes build flags with '-std=c++11' #366

wants to merge 1 commit into from

Conversation

avalchev
Copy link

@avalchev avalchev commented Aug 4, 2016

When included (with add_subdirectory), FMT_USE_CPP11 option pollutes build flags with -std=c++11. If master project has set(CMAKE_CXX_STANDARD 14) , then compilation flags become -std=c++11 -std=gnu++14.

Enable FMT_USE_CPP11 by default only when MASTER_PROJECT is ON, otherwise inherit from master project.

… default FMT_USE_CPP11 only when MASTER_PROJECT is ON.
@vitaut
Copy link
Contributor

vitaut commented Aug 4, 2016

Thanks for the PR! I agree that the library shouldn't add -std=c++11 to compile flags if the parent project already specifies the standard. However, I suggest checking CMAKE_CXX_STANDARD instead of MASTER_PROJECT. Then -std=c++11 will be defined if the parent project doesn't set the standard itself.

@vitaut
Copy link
Contributor

vitaut commented Aug 5, 2016

Does 12a6027 work for you?

@vitaut
Copy link
Contributor

vitaut commented Aug 9, 2016

Closing this in favor of 12a6027, but comments are welcome.

@vitaut vitaut closed this Aug 9, 2016
foonathan pushed a commit that referenced this pull request Oct 23, 2016
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.

2 participants