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

avoid leaking -std=gnu++11 flag to user's targets #127

Merged
merged 1 commit into from
Oct 1, 2018

Conversation

mean-ui-thread
Copy link
Contributor

This fixes #126

@yse
Copy link
Owner

yse commented Sep 18, 2018

Thanks for good advice about private flag with -std=gnu++11. I think it's a very good solution of problem #71.
Can you please add set(CMAKE_CXX_STANDARD 11) in subdirectories (profler_gui, easy_profiler_converter etc) because we need to set the flag explicitly now =)

@mean-ui-thread
Copy link
Contributor Author

@yse sure. however, adding set(CMAKE_CXX_STANDARD 11) to the root level CMakeLists.txt will also accomplish the same thing with a lot less effort. Please bare in mind that CMAKE_CXX_STANDARD only works from cmake 3.1 and up. older cmake versions would require manually adding -std=gnu++11 like the way you've done already.

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif ()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yse job is done. This will affect every subdirectories (core, gui, etc) and won't propagate upward for those who are adding easy_profiler as a subdirectory in their project.

endif ()
set_target_properties(easy_profiler PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED ON)
endif ()
endif ()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yse no longer needed. Taken care of by the root cmakelists.txt now.

@mean-ui-thread
Copy link
Contributor Author

@yse are you okay with my latest change proposal?

@yse
Copy link
Owner

yse commented Oct 1, 2018

Oh, excuse me, I was very busy in other project and missed some letters.
Very good patch. Thanks a lot!

@yse yse merged commit 1eb2fa4 into yse:develop Oct 1, 2018
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.

-std=gnu++11 c++ flags leaks into users's c and C++ compiler flags
2 participants