-
Notifications
You must be signed in to change notification settings - Fork 447
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
add c++11 flags in cmake build system #152
base: master
Are you sure you want to change the base?
Conversation
@weatherhead99 Does this fix anything? Because, I am setting: The only thing worth adding, would be a cmake error, when even |
hmmm, I do see your point. I encountered this the other day when building against GCC 4.8. The library works, all unit tests pass and my project using it has no issues, but it won't built because unless you pass -std=c++11, gcc 4.8 will not compile c++11 constructs. setting CMAKE_CXX_STANDARD will add these flags to compilers where c++11 is not the default. Note, however, your detection of maximum available c++ standard will still report 11 on gcc 4.8, because it is available. It just doesn't add the flags to compiling. |
GCC 4.8, should also use the flag in c++11 PS: What about your PR with conan? |
it does print Using c++: 11, but does not append -std=c++11 to the build (NOTE: this is gcc 4.8 , not 4.9, where it works without this flag). Re; Conan, work on the released 0.9.6 has started here: https://github.com/weatherhead99/conan-rttr/tree/v0.9.6 still have some issues with building on some versions of apple-clang and MSVC. As soon as those are fixed, will PR against your repo :-) |
It seems to be not implemented for older compilers, so a CMake issue. |
@weatherhead99 |
This patch enforces needing a c++11 compiler from within the CMake build system. Also adds appropriate c++11 flags in a cross platform way (e.g. if building on gcc < 5.0)