James E. King, III | 07f5997 | 2017-03-10 06:18:33 -0500 | [diff] [blame^] | 1 | :: |
| 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 | |
| 15 | SETLOCAL EnableDelayedExpansion |
| 16 | |
| 17 | SET PACKAGE=zlib-%ZLIB_VERSION% |
| 18 | SET BUILDDIR=%WIN3P%\zlib-build |
| 19 | SET INSTDIR=%WIN3P%\zlib-inst |
| 20 | SET SRCDIR=%WIN3P%\%PACKAGE% |
| 21 | SET URLFILE=%PACKAGE%.tar.gz |
| 22 | |
| 23 | :: This allows us to tolerate when the current version is archived |
| 24 | SET URL=http://zlib.net/%URLFILE% |
| 25 | SET FURL=http://zlib.net/fossils/%URLFILE% |
| 26 | |
| 27 | :: Download |
| 28 | CD "%WIN3P%" || EXIT /B |
| 29 | appveyor DownloadFile "%URL%" |
| 30 | IF ERRORLEVEL 1 ( |
| 31 | appveyor DownloadFile "%FURL%" || EXIT /B |
| 32 | ) |
| 33 | 7z x "%URLFILE%" -so | 7z x -si -ttar > nul || EXIT /B |
| 34 | |
| 35 | :: Generate |
| 36 | MKDIR "%BUILDDIR%" || EXIT /B |
| 37 | CD "%BUILDDIR%" || EXIT /B |
| 38 | cmake "%SRCDIR%" ^ |
| 39 | -G"NMake Makefiles" ^ |
| 40 | -DCMAKE_INSTALL_PREFIX="%INSTDIR%" ^ |
| 41 | -DCMAKE_BUILD_TYPE="%CONFIGURATION%" || EXIT /B |
| 42 | |
| 43 | :: Build |
| 44 | nmake /fMakefile install || EXIT /B |
| 45 | IF "%CONFIGURATION%" == "Debug" ( |
| 46 | COPY "%BUILDDIR%\zlibd.pdb" "%INSTDIR%\bin\" || EXIT /B |
| 47 | ) |
| 48 | |
| 49 | ENDLOCAL |