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