|
1 | 1 | @echo off |
2 | | -rem libpng 1.6.39 |
3 | | -if exist lpng1639.zip goto srcfound |
4 | | -curl -OJL https://download.sourceforge.net/libpng/lpng1639.zip |
| 2 | +rem libpng 1.6.50 |
| 3 | + |
| 4 | +if "%1%" == "uninstall" goto uninstall |
| 5 | + |
| 6 | +if exist lpng1650.zip goto srcfound |
| 7 | +curl -OJL https://download.sourceforge.net/libpng/lpng1650.zip |
5 | 8 |
|
6 | 9 | :srcfound |
7 | | -if exist lpng1639 goto dirfound |
8 | | -PowerShell Expand-Archive -Path lpng1639.zip -DestinationPath . |
| 10 | +if exist lpng1650 goto dirfound |
| 11 | +PowerShell Expand-Archive -Path lpng1650.zip -DestinationPath . |
9 | 12 |
|
10 | 13 | :dirfound |
11 | | -if exist zlib1213.zip goto zipfound |
12 | | -curl -OJL https://zlib.net/zlib1213.zip |
| 14 | +if exist zlib131.zip goto zipfound |
| 15 | +curl -OJL https://zlib.net/zlib131.zip |
13 | 16 |
|
14 | 17 | :zipfound |
15 | | -if exist zlib-1.2.13 goto zipdirfound |
16 | | -PowerShell Expand-Archive -Path zlib1213.zip -DestinationPath . |
| 18 | +if exist zlib-1.3.1 goto zipdirfound |
| 19 | +PowerShell Expand-Archive -Path zlib131.zip -DestinationPath . |
17 | 20 |
|
18 | 21 | :zipdirfound |
19 | | -cd lpng1639 |
| 22 | +cd lpng1650 |
20 | 23 |
|
21 | 24 | :build |
22 | | -nmake -f scripts\makefile.vcwin32 clean |
| 25 | +powershell "(Get-Content projects\vstudio\zlib.props).Replace('..\..\..\..\zlib<', '..\..\..\..\zlib-1.3.1<') | Set-Content projects\vstudio\zlib.props" |
| 26 | +rem nmake -f scripts\makefile.vcwin32 clean |
23 | 27 | copy /y scripts\pnglibconf.h.prebuilt pnglibconf.h |
24 | | -nmake -f scripts\makefile.vcwin32 AR="link -lib" CFLAGS="-nologo -MT -O2 -W3 -I..\zlib-1.2.13" all |
25 | | -rem msbuild projects\vstudio\libpng\libpng.vcxproj "/p:Configuration=Release Library" /p:SolutionDir=../ /p:Platform=win32 /p:PlatformToolset=v142 |
| 28 | +rem nmake -f scripts\makefile.vcwin32 AR="link -lib" CFLAGS="-nologo -MT -O2 -W3 -I..\zlib-1.3.1" all |
| 29 | +msbuild projects\vstudio\libpng\libpng.vcxproj "/p:Configuration=Release Library" /p:SolutionDir=../ /p:Platform=Win32 /p:PlatformToolset=v143 /t:Rebuild |
| 30 | + |
| 31 | +powershell "(Get-Content projects\vstudio\libpng\libpng.vcxproj).Replace('Win32', 'X64') | Set-Content projects\vstudio\libpng\libpng.vcxproj" |
| 32 | +msbuild projects\vstudio\libpng\libpng.vcxproj "/p:Configuration=Release Library" /p:SolutionDir=../ /p:Platform=X64 /p:PlatformToolset=v143 /t:Rebuild |
| 33 | +powershell "(Get-Content projects\vstudio\libpng\libpng.vcxproj).Replace('X64', 'Win32') | Set-Content projects\vstudio\libpng\libpng.vcxproj" |
| 34 | + |
| 35 | +if not "%1%" == "install" goto end |
| 36 | +copy png.h ..\libpng |
| 37 | +copy pngconf.h ..\libpng |
| 38 | +copy pngpriv.h ..\libpng |
| 39 | +copy pnglibconf.h ..\libpng\Windows |
| 40 | +copy "projects\vstudio\Release Library\libpng16.lib" ..\..\lib\libpng16-vs2022.lib |
| 41 | +copy "projects\vstudio\X64\Release Library\libpng16.lib" ..\..\lib\X64\libpng16-vs2022.lib |
| 42 | +goto end |
| 43 | + |
| 44 | +:uninstall |
| 45 | +git checkout -- libpng\png.h |
| 46 | +git checkout -- libpng\pngconf.h |
| 47 | +git checkout -- libpng\pngpriv.h |
| 48 | +git checkout -- libpng\Windows\pnglibconf.h |
| 49 | +git checkout -- ..\lib\libpng16-vs2017.lib |
| 50 | +git checkout -- ..\lib\x64\libpng16-vs2019.lib |
| 51 | + |
| 52 | +:end |
| 53 | +if exist png.h cd .. |
0 commit comments