]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
CMake: Allow building xz with Visual Studio 2015 and later.
authorLasse Collin <lasse.collin@tukaani.org>
Tue, 12 Sep 2023 20:43:49 +0000 (23:43 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Fri, 22 Sep 2023 17:06:27 +0000 (20:06 +0300)
Building the command line tools xz and xzdec with the combination
of CMake + Visual Studio 2015/2017/2019/2022 works now.

VS2013 update 2 should still be able to build liblzma.
VS2013 cannot build the xz command line tool because xz
needs snprintf() that roughly conforms to C99.
VS2013 is old and no extra code will be added to support it.

Thanks to Kelvin Lee and Jia Tan for testing.

CMakeLists.txt

index c265cac4614a71bd47f349f4750ee60a1184773b..d2fe35df0157b7a1f0731ff583e84c19984634fb 100644 (file)
@@ -1081,7 +1081,7 @@ endif()
 # xz
 #############################################################################
 
-if(NOT MSVC)
+if(NOT MSVC OR MSVC_VERSION GREATER_EQUAL 1900)
     add_executable(xz
         src/common/mythread.h
         src/common/sysdefs.h