From 5020b7fee432e66c24e7ca025786d685faf9003c Mon Sep 17 00:00:00 2001 From: "Al. Lopez" <67606569+AL2009man@users.noreply.github.com> Date: Mon, 10 Aug 2026 14:25:18 -0400 Subject: [PATCH 1/4] fixed msvc compile build to prevent SDL3 cmake build to fail --- CMakeLists.txt | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fd7600401..3df1e9aff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,18 @@ # CMake 3.15 is required for CMAKE_MSVC_RUNTIME_LIBRARY. cmake_minimum_required(VERSION 3.15) + +if(MSVC) + # Pin both charsets. Sources are UTF-8; narrow string literals are Windows-1252, + # because the .vf bitmap fonts are indexed by Windows-1252 byte value and several + # literals embed those bytes directly (\x95 bullet, \xA6 chat prefix, ...). + # Without this the ordinary literal encoding follows the build machine's system + # code page: on a DBCS locale such as 932 those bytes become invalid multi-byte + # sequences and std::format throws std::format_error at runtime. + # Set via _INIT variables before project() to prevent CMake 3.23+ /utf-8 conflict. + set(CMAKE_C_FLAGS_INIT "/source-charset:utf-8 /execution-charset:windows-1252") + set(CMAKE_CXX_FLAGS_INIT "/source-charset:utf-8 /execution-charset:windows-1252") +endif() + project(AlpineFaction) if(NOT "${CMAKE_SIZEOF_VOID_P}" STREQUAL "4") @@ -35,13 +48,8 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) if(MSVC) add_compile_definitions(_CRT_SECURE_NO_WARNINGS) add_compile_options(/arch:SSE2) - # Pin both charsets. Sources are UTF-8; narrow string literals are Windows-1252, - # because the .vf bitmap fonts are indexed by Windows-1252 byte value and several - # literals embed those bytes directly (\x95 bullet, \xA6 chat prefix, ...). - # Without this the ordinary literal encoding follows the build machine's system - # code page: on a DBCS locale such as 932 those bytes become invalid multi-byte - # sequences and std::format throws std::format_error at runtime. - add_compile_options(/source-charset:utf-8 /execution-charset:windows-1252) + # Charset flags set via CMAKE_*_FLAGS_INIT before project() to prevent CMake 3.23+ + # from adding conflicting /utf-8. See preamble for detailed explanation. # Statically link Microsoft's CRT. set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") else() From b5def1a078f221634e400a1bc06daa8efcd5627b Mon Sep 17 00:00:00 2001 From: AL2009man Date: Mon, 10 Aug 2026 23:14:50 -0400 Subject: [PATCH 2/4] move global charset handlingly to avoid vendor conflicts Co-Authored-By: Chris Parsons <17713962+GooberRF@users.noreply.github.com> --- CMakeLists.txt | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3df1e9aff..799a3177a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,18 +1,5 @@ # CMake 3.15 is required for CMAKE_MSVC_RUNTIME_LIBRARY. cmake_minimum_required(VERSION 3.15) - -if(MSVC) - # Pin both charsets. Sources are UTF-8; narrow string literals are Windows-1252, - # because the .vf bitmap fonts are indexed by Windows-1252 byte value and several - # literals embed those bytes directly (\x95 bullet, \xA6 chat prefix, ...). - # Without this the ordinary literal encoding follows the build machine's system - # code page: on a DBCS locale such as 932 those bytes become invalid multi-byte - # sequences and std::format throws std::format_error at runtime. - # Set via _INIT variables before project() to prevent CMake 3.23+ /utf-8 conflict. - set(CMAKE_C_FLAGS_INIT "/source-charset:utf-8 /execution-charset:windows-1252") - set(CMAKE_CXX_FLAGS_INIT "/source-charset:utf-8 /execution-charset:windows-1252") -endif() - project(AlpineFaction) if(NOT "${CMAKE_SIZEOF_VOID_P}" STREQUAL "4") @@ -48,13 +35,10 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) if(MSVC) add_compile_definitions(_CRT_SECURE_NO_WARNINGS) add_compile_options(/arch:SSE2) - # Charset flags set via CMAKE_*_FLAGS_INIT before project() to prevent CMake 3.23+ - # from adding conflicting /utf-8. See preamble for detailed explanation. # Statically link Microsoft's CRT. set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") else() add_compile_options(-msse2) - add_compile_options(-finput-charset=UTF-8 -fexec-charset=WINDOWS-1252) endif() # Macros @@ -89,6 +73,19 @@ macro(setup_debug_info target) endmacro() add_subdirectory(vendor) + +# Pin both charsets for Alpine Faction's own code. Sources are UTF-8; narrow string literals are Windows-1252, +# because the .vf bitmap fonts are indexed by Windows-1252 byte value and several literals embed those bytes +# directly (\x95 bullet, \xA6 chat prefix, ...). Without this the ordinary literal encoding follows the build +# machine's system code page: on a DBCS locale such as 932 those bytes become invalid multi-byte sequences and +# std::format throws std::format_error at runtime. +# This is applied AFTER vendor/ so third-party code keeps its own charset settings. +if(MSVC) + add_compile_options(/source-charset:utf-8 /execution-charset:windows-1252) +else() + add_compile_options(-finput-charset=UTF-8 -fexec-charset=WINDOWS-1252) +endif() + add_subdirectory(launcher_common) add_subdirectory(launcher) add_subdirectory(common) From 50c44706820fb30a9bc8a826f9daea975416e44b Mon Sep 17 00:00:00 2001 From: AL2009man Date: Mon, 10 Aug 2026 23:24:10 -0400 Subject: [PATCH 3/4] reduce bloated notes, just to be more straight forward --- CMakeLists.txt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 799a3177a..635b702a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,12 +74,9 @@ endmacro() add_subdirectory(vendor) -# Pin both charsets for Alpine Faction's own code. Sources are UTF-8; narrow string literals are Windows-1252, -# because the .vf bitmap fonts are indexed by Windows-1252 byte value and several literals embed those bytes -# directly (\x95 bullet, \xA6 chat prefix, ...). Without this the ordinary literal encoding follows the build -# machine's system code page: on a DBCS locale such as 932 those bytes become invalid multi-byte sequences and -# std::format throws std::format_error at runtime. -# This is applied AFTER vendor/ so third-party code keeps its own charset settings. +# Pin charsets to Alpine Faction code only (applied after vendor/ to avoid conflicts). +# UTF-8 sources, Windows-1252 literals for .vf bitmap font indexing. +# Prevents std::format_error on DBCS locales. if(MSVC) add_compile_options(/source-charset:utf-8 /execution-charset:windows-1252) else() From 1d7887d58cd8c82589b6828988fd4e9eb3aaa39c Mon Sep 17 00:00:00 2001 From: AL2009man Date: Mon, 10 Aug 2026 23:27:57 -0400 Subject: [PATCH 4/4] Revert "reduce bloated notes, just to be more straight forward" This reverts commit 50c44706820fb30a9bc8a826f9daea975416e44b. --- CMakeLists.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 635b702a4..799a3177a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,9 +74,12 @@ endmacro() add_subdirectory(vendor) -# Pin charsets to Alpine Faction code only (applied after vendor/ to avoid conflicts). -# UTF-8 sources, Windows-1252 literals for .vf bitmap font indexing. -# Prevents std::format_error on DBCS locales. +# Pin both charsets for Alpine Faction's own code. Sources are UTF-8; narrow string literals are Windows-1252, +# because the .vf bitmap fonts are indexed by Windows-1252 byte value and several literals embed those bytes +# directly (\x95 bullet, \xA6 chat prefix, ...). Without this the ordinary literal encoding follows the build +# machine's system code page: on a DBCS locale such as 932 those bytes become invalid multi-byte sequences and +# std::format throws std::format_error at runtime. +# This is applied AFTER vendor/ so third-party code keeps its own charset settings. if(MSVC) add_compile_options(/source-charset:utf-8 /execution-charset:windows-1252) else()