aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhuangqinjin <huangqinjin@gmail.com>2021-12-13 20:49:21 +0800
committerLasse Collin <lasse.collin@tukaani.org>2022-07-12 19:03:51 +0300
commitfeb80ace866c3033cefbc39f6b07ada83e316e6a (patch)
tree11860b777da1be5ea7178c38ab359b245f020c46
parentxzgrep: Update man page timestamp. (diff)
downloadxz-feb80ace866c3033cefbc39f6b07ada83e316e6a.tar.xz
CMake: Keep compatible with Windows 95 for 32-bit build.
-rw-r--r--CMakeLists.txt12
1 files changed, 11 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1dfdb4f1..49fcd777 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -164,7 +164,17 @@ endif()
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads REQUIRED)
if(CMAKE_USE_WIN32_THREADS_INIT)
- add_compile_definitions(MYTHREAD_VISTA)
+ if(CMAKE_SIZEOF_VOID_P EQUAL 4)
+ # Define to 1 when using Windows 95 (and thus XP) compatible threads. This
+ # avoids use of features that were added in Windows Vista.
+ # This is used for 32-bit x86 builds for compatibility reasons since it
+ # makes no measurable difference in performance compared to Vista threads.
+ add_compile_definitions(MYTHREAD_WIN95)
+ else()
+ # Define to 1 when using Windows Vista compatible threads. This uses features
+ # that are not available on Windows XP.
+ add_compile_definitions(MYTHREAD_VISTA)
+ endif()
else()
add_compile_definitions(MYTHREAD_POSIX)