From 75ceaec54ea8664736d08146ec2f1ce1b84afec7 Mon Sep 17 00:00:00 2001 From: NyakoFox Date: Mon, 18 May 2026 17:47:10 -0300 Subject: [PATCH] Add WINXP option to CMakeLists.txt This is a new option (off by default, on for official builds) which tell Physfs to support Windows XP. Without it, it tries to use a function from Vista (existed in XP, but was an external thing). --- desktop_version/CMakeLists.txt | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/desktop_version/CMakeLists.txt b/desktop_version/CMakeLists.txt index 4112a7c8..82a9a0f2 100644 --- a/desktop_version/CMakeLists.txt +++ b/desktop_version/CMakeLists.txt @@ -16,9 +16,14 @@ option(OFFICIAL_BUILD "Compile an official build of the game" OFF) option(MAKEANDPLAY "Compile a version of the game without the main campaign (provided for convenience; consider modifying MakeAndPlay.h instead" OFF) -if(OFFICIAL_BUILD AND NOT MAKEANDPLAY) - set(STEAM ON) - set(GOG ON) +option(WINXP "Compile with Windows XP support. You must set your toolkit version to v141_xp for this to work." OFF) + +if(OFFICIAL_BUILD) + set(WINXP ON) + if(NOT MAKEANDPLAY) + set(STEAM ON) + set(GOG ON) + endif() endif() option(REMOVE_ABSOLUTE_PATHS "If supported by the compiler, replace all absolute paths to source directories compiled into the binary (if any) with relative paths" ON) @@ -367,6 +372,11 @@ if(BUNDLE_DEPENDENCIES) target_compile_definitions(physfs-static PRIVATE -DPHYSFS_SUPPORTS_DEFAULT=0 -DPHYSFS_SUPPORTS_ZIP=1 ) + + if(MSVC AND WINXP) + target_compile_definitions(physfs-static PRIVATE -D_WIN32_WINNT=0x0501) + endif() + add_library(faudio-static STATIC ${FAUDIO_SRC}) target_include_directories( faudio-static PRIVATE