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).
This commit is contained in:
NyakoFox
2026-08-11 10:43:05 -04:00
committed by Ethan Lee
parent dc2504e560
commit 75ceaec54e
+13 -3
View File
@@ -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) 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) option(WINXP "Compile with Windows XP support. You must set your toolkit version to v141_xp for this to work." OFF)
set(STEAM ON)
set(GOG ON) if(OFFICIAL_BUILD)
set(WINXP ON)
if(NOT MAKEANDPLAY)
set(STEAM ON)
set(GOG ON)
endif()
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) 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 target_compile_definitions(physfs-static PRIVATE
-DPHYSFS_SUPPORTS_DEFAULT=0 -DPHYSFS_SUPPORTS_ZIP=1 -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}) add_library(faudio-static STATIC ${FAUDIO_SRC})
target_include_directories( target_include_directories(
faudio-static PRIVATE faudio-static PRIVATE