From 45925badfda651d690e626612ebf32af17f69e8d Mon Sep 17 00:00:00 2001 From: sukibaby <163092272+sukibaby@users.noreply.github.com> Date: Fri, 23 May 2025 19:09:16 -0700 Subject: [PATCH] Update Windows build flags /MP2 limits the build processes to a maximum of 2. Many CPU's nowadays have more than two cores, so the integer specifier is removed so that the build is not artificially constrained to two cores. /FS allows multiple compiler processes to write to the .pdb file; it should be used in conjunction with /MP to speed up the build. /permissive- disables certain MSVC-specific extensions and follows the C standard more closely. Using this flag should help to ensure behavior matches gcc & clang a little more closely. Note, /utf-8 does NOT build the program with Unicode support. It merely indicates to the compiler that the source files are using UTF-8 encoding. --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 50e770fe70..e187314fda 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -150,7 +150,7 @@ endif() if(MSVC) # TODO: Find a way to do this cleanly for non MSVC users. - set(SM_COMPILE_FLAGS "${SM_COMPILE_FLAGS} /MP2 /utf-8") + set(SM_COMPILE_FLAGS "${SM_COMPILE_FLAGS} /MP /permissive- /utf-8") endif() set_target_properties("${SM_EXE_NAME}"