From 3268db0ae87bbec13976fc6ff42c998f0498b8d1 Mon Sep 17 00:00:00 2001 From: Scott Rankin Date: Tue, 5 Apr 2022 05:54:29 +0100 Subject: [PATCH] cmake: msvc: avoid having to use both preprocessor flags https://github.com/warmcat/libwebsockets/issues/2600 --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c4cd2949c..d56ee920b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -849,7 +849,11 @@ if (MSVC) # Fail the build if any warnings add_compile_options(/W3 /WX) # Unbreak MSVC broken preprocessor __VA_ARGS__ behaviour - add_compile_options(/Zc:preprocessor /experimental:preprocessor /wd5105) + if (MSVC_VERSION GREATER 1925) + add_compile_options(/Zc:preprocessor /wd5105) + else() + add_compile_options(/experimental:preprocessor /wd5105) + endif() endif(MSVC) if (MINGW)