From 3b47e4ac3800bc499b7106d8e4bac727d4db0ae4 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Tue, 1 Apr 2025 19:23:39 +0100 Subject: [PATCH] Set /Zc:__cplusplus when building on MSVC This may trigger dependencies to use C++11/14/17 code paths. --- CMakeLists.txt | 2 +- cmake/tests.cmake | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 36583e14..bf76c372 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -364,7 +364,7 @@ endif() if(MSVC) # Turn off permissive mode to be more standards-compliant and avoid compiler errors. - target_compile_options(loot PRIVATE "/permissive-" "/W4") + target_compile_options(loot PRIVATE "/Zc:__cplusplus" "/permissive-" "/W4") endif() ############################## diff --git a/cmake/tests.cmake b/cmake/tests.cmake index 985c898d..2584fe26 100644 --- a/cmake/tests.cmake +++ b/cmake/tests.cmake @@ -166,10 +166,11 @@ endif() if(MSVC) # Turn off permissive mode to be more standards-compliant and avoid compiler errors. - target_compile_options(libloot_tests PRIVATE "/permissive-" "/W4") + target_compile_options(libloot_tests PRIVATE "/Zc:__cplusplus" "/permissive-" "/W4") # Set /bigobj to allow building Debug and RelWithDebInfo tests target_compile_options(libloot_internals_tests PRIVATE + "/Zc:__cplusplus" "/permissive-" "/W4" "$<$,$>:/bigobj>")