summaryrefslogtreecommitdiffstats
path: root/windows/INSTALL-MSVC.txt
blob: 2fdd1e7b02d280dca07cd3bcf54720466630e569 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Building XZ Utils with Microsoft Visual Studio
==============================================

Introduction
------------

    MSVC 2013 update 2 and later have enough C99 support to build
    liblzma from XZ Utils 5.2.0 and later without modifications.
    Older MSVC versions would require a large number of changes to
    the XZ Utils code and thus the old MSVC versions aren't supported.

    As of 2015-06-19, some work has been done to get xz.exe and other
    command line tools built with MSVC, but it's not complete enough
    to be included in XZ Utils.


Building
--------

    It is recommended to use CMake to generate build files for MSVC.
    The project files in vs201x directories will be removed in the
    future (5.4.x releases will include them still).

    Descriptions of the files in the vs201x directories:

        config.h              liblzma configuration #defines for MSVC.
        liblzma.vcxproj       This builds static liblzma.
        liblzma_dll.vcxproj   This builds liblzma.dll.
        xz_win.sln            Solution using the above project files.

    The projects have x86 and x86-64 platform configurations, as well
    as a Debug, Release, and ReleaseMT configuration -- MT is the
    compiler switch to link to the CRT statically, so it will not
    have any other DLL dependencies.

    The VS2017 project files don't set <WindowsTargetPlatformVersion>.
    This means that you may need to either install Windows SDK 8.1 or
    you may need to set the target platform version before building.

    Currently no test programs are built or run under MSVC from the
    project files. CMake-based builds include tests too.


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>.

    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.