2 Building XZ Utils with Microsoft Visual Studio
3 ==============================================
8 liblzma got MSVC support in XZ Utils 5.2.0, and the xz, xzdec,
9 lzmadec, and lzmainfo command line tools in XZ Utils 5.6.0.
11 Visual Studio 2015 and later are supported.
13 NOTE: The *.exe files are linked against GNU getopt_long from
14 the "lib" directory. That code is under the GNU LGPLv2.1
15 and thus the matching source code must be provided when
16 distributing the *.exe files. The simplest way to comply with
17 the license requirements is to distribute the matching XZ Utils
18 source package alongside the *.exe files.
24 Use CMake to generate build files for MSVC. Visual Studio project
25 files are no longer provided (XZ Utils 5.4.x were the last versions
26 to include the project files).
28 NOTE: GCC and Clang compatible inline assembly isn't supported by
29 the MSVC compiler. Using clang-cl under MSVC should make inline
30 assembly work (untested).
36 liblzma API headers declare the functions with __declspec(dllimport)
37 by default. To avoid this when using static liblzma from your code,
38 #define LZMA_API_STATIC before #including <lzma.h>.
40 MSVC gives a bunch of compiler warnings. Some warnings are specific
41 to 32-bit or 64-bit build and some appear for both builds. These
42 are known and shouldn't be a problem. Some of them will probably
43 be fixed in the future.