tzlaine / parser

A C++ parser combinator library.
Boost Software License 1.0
69 stars 12 forks source link

Fix cmake and MSVC Compiler issues #170

Open d5ch4k opened 2 months ago

d5ch4k commented 2 months ago

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