From f53a7a2b6642417213138a9e22c2cefe79d9095b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Sat, 21 Nov 2020 14:27:39 +0100 Subject: [PATCH] CMake: Pass various /Zc flags to MSVC for consistency with Base.props https://github.com/dolphin-emu/dolphin/pull/9037/commits/969ea6e4f54f1021edaa8f565e20b17a78f6f753 Fixes non-conformant handling of __VA_ARGS__. --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1748ed9347..2a04eba0d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -244,6 +244,13 @@ if(CMAKE_C_COMPILER_ID MATCHES "MSVC") add_compile_options(/volatile:iso) # Fix non-conformant lambda behavior (constexpr variables shouldn't need capturing) add_compile_options(/experimental:newLambdaProcessor) + # Fix various other non-conformant behaviors + add_compile_options(/Zc:externConstexpr,lambda,preprocessor) + + # Temporarily disable warnings to enable /Zc:preprocessor compatibility with WinSDK headers. + add_compile_options( + /wd5105 # macro expansion producing 'defined' has undefined behavior + ) string(APPEND CMAKE_EXE_LINKER_FLAGS " /NXCOMPAT") else()