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 NOTE: The *.exe files are linked against GNU getopt_long from
12 the "lib" directory. That code is under the GNU LGPLv2.1
13 and thus the matching source code must be provided when
14 distributing the *.exe files. The simplest way to comply with
15 the license requirements is to distribute the matching XZ Utils
16 source package alongside the *.exe files.
18 MSVC 2013 update 2 and later have enough C99 support to build
19 liblzma from XZ Utils 5.2.0 and later without modifications.
21 Visual Studio 2015 or later is required to build the command line
28 Use CMake to generate build files for MSVC. Visual Studio project
29 files are no longer provided (XZ Utils 5.4.x were the last versions
30 to include the project files).
32 NOTE: GCC and Clang compatible inline assembly isn't supported by
33 the MSVC compiler. Using clang-cl under MSVC should make inline
34 assembly work (untested).
40 liblzma API headers declare the functions with __declspec(dllimport)
41 by default. To avoid this when using static liblzma from your code,
42 #define LZMA_API_STATIC before #including <lzma.h>.
44 MSVC gives a bunch of compiler warnings. Some warnings are specific
45 to 32-bit or 64-bit build and some appear for both builds. These
46 are known and shouldn't be a problem. Some of them will probably
47 be fixed in the future.