blob: d8811a1538f05d926fb40b5e14c4061e8e63f2c7 [file] [log] [blame]
James E. King, III07f59972017-03-10 06:18:33 -05001::
2:: Licensed under the Apache License, Version 2.0 (the "License");
3:: you may not use this file except in compliance with the License.
4:: You may obtain a copy of the License at
5::
6:: http://www.apache.org/licenses/LICENSE-2.0
7::
8:: Unless required by applicable law or agreed to in writing, software
9:: distributed under the License is distributed on an "AS IS" BASIS,
10:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11:: See the License for the specific language governing permissions and
12:: limitations under the License.
13::
14
15SETLOCAL EnableDelayedExpansion
16
17SET PACKAGE=zlib-%ZLIB_VERSION%
18SET BUILDDIR=%WIN3P%\zlib-build
19SET INSTDIR=%WIN3P%\zlib-inst
20SET SRCDIR=%WIN3P%\%PACKAGE%
21SET URLFILE=%PACKAGE%.tar.gz
22
23:: This allows us to tolerate when the current version is archived
24SET URL=http://zlib.net/%URLFILE%
25SET FURL=http://zlib.net/fossils/%URLFILE%
26
27:: Download
28CD "%WIN3P%" || EXIT /B
29appveyor DownloadFile "%URL%"
30IF ERRORLEVEL 1 (
31 appveyor DownloadFile "%FURL%" || EXIT /B
32)
337z x "%URLFILE%" -so | 7z x -si -ttar > nul || EXIT /B
34
35:: Generate
36MKDIR "%BUILDDIR%" || EXIT /B
37CD "%BUILDDIR%" || EXIT /B
38cmake "%SRCDIR%" ^
39 -G"NMake Makefiles" ^
40 -DCMAKE_INSTALL_PREFIX="%INSTDIR%" ^
41 -DCMAKE_BUILD_TYPE="%CONFIGURATION%" || EXIT /B
42
43:: Build
44nmake /fMakefile install || EXIT /B
45IF "%CONFIGURATION%" == "Debug" (
46 COPY "%BUILDDIR%\zlibd.pdb" "%INSTDIR%\bin\" || EXIT /B
47)
48
49ENDLOCAL