From a4ed8d81524383fe7f48d53cbb6cb34056838825 Mon Sep 17 00:00:00 2001 From: Jesper Juhl Date: Wed, 3 Jun 2026 05:27:23 +0200 Subject: [PATCH 1/3] Make MSVC report the correct value for __cplusplus --- cmake/Macros.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/Macros.cmake b/cmake/Macros.cmake index b3394001f..c8679b151 100644 --- a/cmake/Macros.cmake +++ b/cmake/Macros.cmake @@ -51,6 +51,7 @@ function(tgui_set_global_compile_flags target) $<$:/WX> /W4 /permissive- + /Zc:__cplusplus ) else() target_compile_options(${target} PRIVATE From 6b531027eb1752c54e18f064f46edbb984c9b016 Mon Sep 17 00:00:00 2001 From: Jesper Juhl Date: Wed, 3 Jun 2026 05:28:34 +0200 Subject: [PATCH 2/3] Make MSVC use a standard compliant preprocessor --- cmake/Macros.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/Macros.cmake b/cmake/Macros.cmake index c8679b151..f29de0381 100644 --- a/cmake/Macros.cmake +++ b/cmake/Macros.cmake @@ -52,6 +52,7 @@ function(tgui_set_global_compile_flags target) /W4 /permissive- /Zc:__cplusplus + /Zc:preprocessor ) else() target_compile_options(${target} PRIVATE From 3b2bca975ac682eab0b35b99ae90188b53e909c2 Mon Sep 17 00:00:00 2001 From: Jesper Juhl Date: Wed, 3 Jun 2026 05:37:59 +0200 Subject: [PATCH 3/3] Add /Zc:inline for MSVC builds Enforce the C++11 rule that all functions declared inline must have a definition available in the same translation unit if they're used. --- cmake/Macros.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/Macros.cmake b/cmake/Macros.cmake index f29de0381..de3840f68 100644 --- a/cmake/Macros.cmake +++ b/cmake/Macros.cmake @@ -53,6 +53,7 @@ function(tgui_set_global_compile_flags target) /permissive- /Zc:__cplusplus /Zc:preprocessor + /Zc:inline ) else() target_compile_options(${target} PRIVATE