mirror of https://git.tukaani.org/xz.git
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ö.
0570308ddd (commitcomment-129098431)
This commit is contained in:
parent
01e34aa117
commit
d91cb6e884
|
@ -102,9 +102,9 @@ set(CMAKE_MACOSX_BUNDLE OFF)
|
||||||
#
|
#
|
||||||
# CMake 3.27 doesn't have CMAKE_RC_COMPILER_ID so we rely on
|
# CMake 3.27 doesn't have CMAKE_RC_COMPILER_ID so we rely on
|
||||||
# CMAKE_C_COMPILER_ID.
|
# CMAKE_C_COMPILER_ID.
|
||||||
if(WIN32 AND (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR (
|
if((MINGW OR CYGWIN OR MSYS) AND (
|
||||||
CMAKE_C_COMPILER_ID STREQUAL "Clang" AND
|
NOT CMAKE_C_COMPILER_ID STREQUAL "Clang" OR
|
||||||
CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "17")))
|
CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "17"))
|
||||||
# Use workarounds with GNU windres and llvm-windres >= 17.0.0. The \x20
|
# 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
|
# 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.
|
# how to pass different flags to windres and the C compiler.
|
||||||
|
|
Loading…
Reference in New Issue