Skip to content

Commit a40d522

Browse files
committed
Update Windows library build scripts
1 parent ce5cf66 commit a40d522

3 files changed

Lines changed: 86 additions & 25 deletions

File tree

3rdParty/libjpeg.cmd

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
@echo off
2-
if exist jpegsr9d.zip goto srcfound
3-
curl -OJL https://www.ijg.org/files/jpegsr9d.zip
2+
if exist jpegsr9f.zip goto srcfound
3+
curl -OJL https://www.ijg.org/files/jpegsr9f.zip
44
:srcfound
5-
if exist jpeg-9d goto dirfound
6-
PowerShell Expand-Archive -Path jpegsr9d.zip -DestinationPath .
5+
if exist jpeg-9f goto dirfound
6+
PowerShell Expand-Archive -Path jpegsr9f.zip -DestinationPath .
77
:dirfound
8-
cd jpeg-9d
8+
cd jpeg-9f
99
nmake -f Makefile.vs setup-v16
10+
powershell "(Get-Content jpeg.vcxproj).Replace('<Optimization>Full</Optimization>', """"<Optimization>Full</Optimization>`n<RuntimeLibrary>MultiThreaded</RuntimeLibrary>"""") | Set-Content jpeg.vcxproj"
11+
1012
msbuild jpeg.vcxproj /p:Platform=win32 /p:Configuration=Release /p:PlatformToolset=v143
11-
msbuild jpeg.vcxproj /p:Platform=x64 /p:Configuration=Release /p:PlatformToolset=v143
13+
msbuild jpeg.vcxproj /p:Platform=x64 /p:Configuration=Release /p:PlatformToolset=v143
14+
15+
copy jconfig.h ..\libjpeg\Windows
16+
copy jconfig.mac ..\libjpeg\MacOSX\jconfig.h
17+
copy jinclude.h ..\libjpeg\
18+
copy jmorecfg.h ..\libjpeg\
19+
copy jpeglib.h ..\libjpeg\
20+
copy release\win32\jpeg.lib ..\..\lib\libjpeg-vs2022.lib
21+
copy release\x64\jpeg.lib ..\..\lib\x64\libjpeg-vs2022.lib
22+
cd ..

3rdParty/libpng.cmd

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,53 @@
11
@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
58

69
: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 .
912

1013
: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
1316

1417
: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 .
1720

1821
:zipdirfound
19-
cd lpng1639
22+
cd lpng1650
2023

2124
: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
2327
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 ..

3rdParty/zlib-x64.cmd

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,33 @@
11
@echo off
2-
if exist zlib1213.zip goto zipfound
3-
curl -OJL https://zlib.net/zlib1213.zip
2+
if "%1%" == "uninstall" goto uninstall
3+
if exist zlib131.zip goto zipfound
4+
curl -OJL https://zlib.net/zlib131.zip
45

56
:zipfound
6-
if exist zlib-1.2.13 goto zipdirfound
7-
PowerShell Expand-Archive -Path zlib1213.zip -DestinationPath .
7+
if exist zlib-1.3.1 goto zipdirfound
8+
PowerShell Expand-Archive -Path zlib131.zip -DestinationPath .
89

910
:zipdirfound
10-
cd zlib-1.2.13
11-
nmake -f win32/Makefile.msc AS=ml64 CFLAGS="-MT -O2 -nologo -I. -DASMV -DASMINF" clean zlib.lib
11+
cd zlib-1.3.1
12+
powershell "(Get-Content contrib\vstudio\vc17\zlibstat.vcxproj).Replace('MultiThreadedDLL', 'MultiThreaded') | Set-Content contrib\vstudio\vc17\zlibstat.vcxproj"
13+
rem nmake -f win32/Makefile.msc AS=ml64 CFLAGS="-MT -O2 -nologo -I. -DASMV -DASMINF" clean zlib.lib
14+
msbuild contrib\vstudio\vc17\zlibstat.vcxproj /p:Platform=win32 /p:Configuration=Release
15+
msbuild contrib\vstudio\vc17\zlibstat.vcxproj /p:Platform=x64 /p:Configuration=Release
16+
17+
if not "%1%" == "install" goto end
18+
copy contrib\vstudio\vc17\x64\ZlibStatRelease\zlibstat.lib ..\..\lib\x64\zlib-vs2022.lib
19+
copy contrib\vstudio\vc17\x86\ZlibStatRelease\zlibstat.lib ..\..\lib\zlib-vs2022.lib
20+
copy zconf.h ..\..\include\
21+
copy zlib.h ..\..\include\
22+
copy contrib\minizip\unzip.h ..\..\include
23+
rem copy zlib.lib ..\..\lib\x64\zlib-vs2019.lib
24+
goto end
25+
26+
:uninstall
27+
git checkout -- ..\include\zconf.h
28+
git checkout -- ..\include\zlib.h
29+
git checkout -- ..\include\unzip.h
30+
git checkout -- ..\lib\zlib-vs2017.lib
31+
git checkout -- ..\lib\x64\zlib-vs2019.lib
32+
:end
33+
if exist zconf.h cd ..

0 commit comments

Comments
 (0)