aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2023-10-06 18:55:57 +0300
committerLasse Collin <lasse.collin@tukaani.org>2023-10-06 19:32:06 +0300
commitd91cb6e884c73d0b05d7e7d68ad4e6eb29f4b44b (patch)
treea06a042b74af2e65d72fb11808507585d4f5b76d /CMakeLists.txt
parentCI: Disable CLANG64 MSYS2 environment until bug is resolved. (diff)
downloadxz-d91cb6e884c73d0b05d7e7d68ad4e6eb29f4b44b.tar.xz
CMake/Windows: Fix when the windres workaround is applied.
CMake doesn't set WIN32 on CYGWIN but the workaround is probably needed on Cygwin too. Same for MSYS and MSYS2. The workaround must not be used with Clang that is acting in MSVC mode. This fixes it by checking for the known environments that need the workaround instead of using "NOT MSVC". Thanks to Martin Storsjö. https://github.com/tukaani-project/xz/commit/0570308ddd9c0e39e85597ebc0e31d4fc81d436f#commitcomment-129098431
Diffstat (limited to '')
-rw-r--r--CMakeLists.txt6
1 files changed, 3 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c653dc67..e0af3e15 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -102,9 +102,9 @@ set(CMAKE_MACOSX_BUNDLE OFF)
#
# CMake 3.27 doesn't have CMAKE_RC_COMPILER_ID so we rely on
# CMAKE_C_COMPILER_ID.
-if(WIN32 AND (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR (
- CMAKE_C_COMPILER_ID STREQUAL "Clang" AND
- CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "17")))
+if((MINGW OR CYGWIN OR MSYS) AND (
+ NOT CMAKE_C_COMPILER_ID STREQUAL "Clang" OR
+ CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "17"))
# Use workarounds with GNU windres and llvm-windres >= 17.0.0. The \x20
# in PACKAGE_NAME works with gcc and clang too so we don't need to worry
# how to pass different flags to windres and the C compiler.