-
Notifications
You must be signed in to change notification settings - Fork 15
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
Fix cmake and MSVC Compiler issues #170
Conversation
MSVC in cmake has always been a boolean variable ( see https://cmake.org/cmake/help/latest/variable/MSVC.html) detecting the MSVC Compiler requires therefore "if (MSVC)" further, the MSVC Compiler will always emit '199711L' for __cplusplus, if it is called without the option '/Zc:__cplusplus' this odd behavior will break any version check in the headers. e.g. './include/boost/parser/detail/text/detail/begin_end.hpp' or 'boost/hana/traits.hpp therefore "add_compile_options(/Zc:__cplusplus)" is always nrequired for the MSVC compiler
Thanks for doing this. I only recently learned about I'm a little nervous about using Please don't leave a block of commented-out CMake in your PR. :) |
If I type If this is a no-go, then
is the way to go (if we assume, there exist only 2 different command-line styles) Martin |
Oh no I didn't mean you needed to revert it to an older-Cmake way of doing things. 3.14 is pretty old. I was just worried that |
…h pre 3.14 version" This reverts commit eab545e.
I've reverted it and updated the Martin |
Very nice! Thanks again for doing this. |
MSVC in cmake has always been a boolean variable ( see https://cmake.org/cmake/help/latest/variable/MSVC.html)
detecting the MSVC Compiler requires therefore 'if (MSVC)' in CMakeLists.txt
further, the MSVC Compiler will always emit '199711L' for __cplusplus, if it is called without the option '/Zc:__cplusplus'
(see https://learn.microsoft.com/en-us/cpp/build/reference/zc-cplusplus?view=msvc-170 )
this odd behavior will break any version check in the headers.
e.g. './include/boost/parser/detail/text/detail/begin_end.hpp'
or 'boost/hana/traits.hpp'
therefore 'add_compile_options(/Zc:__cplusplus)' is always required for the MSVC compiler