OVMS3/OVMS.V3/components/zip/libzip/vstudio
2022-04-06 00:04:46 +02:00
..
zlib Initial commit, fork from original Project 2022-04-06 00:04:46 +02:00
readme.txt Initial commit, fork from original Project 2022-04-06 00:04:46 +02:00

Building libzip with Microsoft Visual C++
=========================================
The script vsbuild.cmd can be used to build (and optionally test) libzip using
Microsoft Visual C++.

Prerequisites
-------------
Windows Server 2003 or Windows Vista or later (tested with Windows 7 x64)
Microsoft Visual Studio (tested with VS2013 Premium)
CMake (tested with version 3.3.1)
Source code for zlib (tested with version 1.2.8)

To run tests, you will also need:
Perl interpreter (tested with ActiveState ActivePerl 5.20.2 64-bit)
CPAN module IPC::Cmd (comes with ActivePerl)

You'll also need to make sure all of the above (specifically: msbuild.exe,
cmake.exe and perl.exe) are in your PATH at the time of running the script.

Unpacking zlib
--------------
Because libzip depends on zlib, the vsbuild.cmd script takes care of building
zlib for you as well. Download the source code from http://zlib.org/ and extract
all the files and subdirectories from the "zlib-x.y.z" directory into
vstudio/zlib.

Building libzip with Visual Studio 2013 for the impatient
---------------------------------------------------------
1. Make sure all the prerequisites (see above) are installed and in your PATH.
2. Don't forget to unpack zlib (see "Unpacking zlib" above).
3. Open a Visual Studio Command Prompt in the "vstudio" directory (the directory
   containing this file).
4. Enter the following command for a 32-bit x86 build:
   vsbuild build "Visual Studio 12" v120
   or for a 64-bit x64 build:
   vsbuild build "Visual Studio 12 Win64" v120

If you'd like to run the tests as well, use one of the following commands:
vsbuild build+test "Visual Studio 12" v120
vsbuild build+test "Visual Studio 12 Win64" v120

Building libzip
---------------
The script vsbuild.cmd has three modes of operation, with the following syntax:
vsbuild clean
vsbuild build <generator> <toolset>
vsbuild build+test <generator> <toolset>

"vsbuild clean" deletes all output and intermediate files and directories
generated by the build process.

"vsbuild build" just builds zlib and libzip and leaves the DLL files in the
following locations:
vstudio/zlib/installed/bin/zlib.dll
vstudio/zlib/installed/bin/zlibd.dll
build/lib/Debug/zip.dll
build/lib/Release/zip.dll

"vsbuild build+test" builds zlib and libzip as above, then runs the libzip
regression test suite.

The "build" and "build+test" commands require the following parameters:

<generator>: The CMake generator to use for project files. This identifies the
version of Visual Studio you're using, and also allows you to specify whether
the 32-bit or 64-bit of the libraries should be built.
I've tested "Visual Studio 12" (VS2013 x86) and "Visual Studio 12 Win64"
(VS2013 x64) but other versions should work as well. Run "cmake --help" for a
list of generators.

<toolset>: Specifies the platform toolset to use. Normally, this will match the
version of Visual Studio (e.g. "v120" for Visual Studio 2013 aka Visual Studio
12). See the Visual Studio documentation for more information about platform
toolsets.

Andrew Molyneux
andrew@molyneuxfamily.co.uk