[CMake] How to detect MSVC 2015 update 3 (= presence of /fpermissive-)
Volker Enderlein
volker.enderlein at ifm-chemnitz.de
Wed May 17 06:18:34 EDT 2017
Hello,
according to https://sourceforge.net/p/predef/wiki/Compilers/ you could
check with
check_cxx_source_compiles("
#if defined (_MSC_VER) && (_MSC_VER == 1900) && (_MSC_FULL_VER ==
190024210)
#else
#error compiler is not MSVC Update3
#endif
int main() {
return 0;
}
" MSVC_UPDATE3_FOUND)
for the requested feature.
HTH, Cheers, Volker
Am 15/05/2017 um 14:56 schrieb René J.V. Bertin:
> Hello,
>
> A question that will hopefully have a quick/easy answer:
>
> I'd like to detect when the MSVC /fpermissive- (yes, that's a dash at the end) can be used instead of /Za . I know that a later update bumped the version to 14.0.25422.01 and thus undoubtedly _MSC_FULL_VER== 1402542201 in C code so I could assume everyone keeps installs their updates and use that value.
>
> But what does this translate to in CMake code (MSVC_VERSION)? Probably not just 1903 I presume?
>
> Thanks,
> René
More information about the CMake
mailing list