-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.cmd
1218 lines (1058 loc) · 46.1 KB
/
build.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
@echo off
setlocal enabledelayedexpansion
rem
rem Architectures
rem
if "%PROCESSOR_ARCHITECTURE%" equ "AMD64" (
set HOST_ARCH=x64
) else if "%PROCESSOR_ARCHITECTURE%" equ "ARM64" (
set HOST_ARCH=arm64
)
if "%1" equ "x64" (
set TARGET_ARCH=x64
) else if "%1" equ "arm64" (
set TARGET_ARCH=arm64
) else if "%1" neq "" (
echo Unknown target "%1" architecture!
exit /b 1
) else (
set TARGET_ARCH=%HOST_ARCH%
)
rem
rem Library Versions
rem
set NASM_VERSION=2.16.03
set YASM_VERSION=1.3.0
set NINJA_VERSION=1.12.1
set ZLIB_VERSION=1.3.1
set BZIP2_VERSION=1.0.8
set XZ_VERSION=5.6.3
set ZSTD_VERSION=1.5.6
set LIBPNG_VERSION=1.6.45
set LIBJPEGTURBO_VERSION=3.1.0
set JBIG_VERSION=2.1
set LERC_VERSION=4.0.0
set TIFF_VERSION=4.7.0
set LIBWEBP_VERSION=1.5.0
set AOM_VERSION=3.11.0
set LIBYUV_VERSION=464c51a
set DAV1D_VERSION=1.5.0
set LIBAVIF_VERSION=1.1.1
set LIBJXL_VERSION=0.11.1
set FREETYPE_VERSION=2.13.3
set HARFBUZZ_VERSION=10.1.0
set LIBOGG_VERSION=1.3.5
set LIBVORBIS_VERSION=1.3.7
set OPUS_VERSION=1.5.2
set OPUSFILE_VERSION=0.12
set FLAC_VERSION=1.4.3
set MPG123_VERSION=1.32.10
set LIBXMP_VERSION=4.6.0
set LIBGME_VERSION=0.6.3
set WAVPACK_VERSION=5.7.0
set LIBSNDFILE_VERSION=1.2.2
rem libjxl dependencies
set BROTLI_COMMIT=36533a8
set HIGHWAY_COMMIT=457c891
set SKCMS_COMMIT=42030a7
rem
rem Output Folder
rem
set OUTPUT=%~dp0SDL3-%TARGET_ARCH%
if not exist %OUTPUT% mkdir %OUTPUT%
rem
rem Temporary Folders
rem
set DOWNLOAD=%~dp0download
set SOURCE=%~dp0source
set BUILD=%~dp0build-%TARGET_ARCH%
set DEPEND=%~dp0depend-%TARGET_ARCH%
if not exist %DOWNLOAD% mkdir %DOWNLOAD% || exit /b 1
if not exist %SOURCE% mkdir %SOURCE% || exit /b 1
if not exist %BUILD% mkdir %BUILD% || exit /b 1
if not exist %DEPEND% mkdir %DEPEND% || exit /b 1
cd %~dp0
set PATH=%DOWNLOAD%;%PATH%
rem
rem Dependencies
rem
where /q git.exe || (
echo ERROR: "git.exe" not found
exit /b 1
)
where /q curl.exe || (
echo ERROR: "curl.exe" not found
exit /b 1
)
where /q cmake.exe || (
echo ERROR: "cmake.exe" not found
exit /b 1
)
where /q perl.exe || (
echo ERROR: "perl.exe" not found
exit /b 1
)
where /q python.exe || (
echo ERROR: "python.exe" not found
exit /b 1
)
where /q pip.exe || (
echo ERROR: "pip.exe" not found
exit /b 1
)
where /q meson.exe || (
pip.exe install meson
where /q meson.exe || (
echo ERROR: "meson.exe" not found
exit /b 1
)
)
rem
rem 7-Zip
rem
if exist "%ProgramFiles%\7-Zip\7z.exe" (
set SZIP="%ProgramFiles%\7-Zip\7z.exe"
) else (
where /q 7za.exe || (
echo ERROR: 7-Zip installation or "7za.exe" not found
exit /b 1
)
set SZIP=7za.exe
)
rem
rem yasm.exe & nasm.exe & ninja.exe
rem
if "%TARGET_ARCH%" equ "x64" (
rem nasm is used for libjpeg-turbo and dav1d
where /q nasm.exe || (
echo Downloading nasm
pushd %DOWNLOAD%
curl.exe -sfLo nasm.zip "https://www.nasm.us/pub/nasm/releasebuilds/%NASM_VERSION%/win64/nasm-%NASM_VERSION%-win64.zip"
%SZIP% x -bb0 -y nasm.zip nasm-%NASM_VERSION%\nasm.exe 1>nul 2>nul || exit /b 1
move nasm-%NASM_VERSION%\nasm.exe nasm.exe 1>nul 2>nul
rd /s /q nasm-%NASM_VERSION% 1>nul 2>nul
popd
)
nasm.exe --version || exit /b 1
rem yasm is used for mpg123
where /q yasm.exe || (
echo Downloading yasm
pushd %DOWNLOAD%
curl -sfLo yasm.exe https://www.tortall.net/projects/yasm/releases/yasm-%YASM_VERSION%-win64.exe || exit /b 1
popd
if "%GITHUB_WORKFLOW%" neq "" (
rem Install VS2010 redistributable
curl -sfLO https://download.microsoft.com/download/3/2/2/3224B87F-CFA0-4E70-BDA3-3DE650EFEBA5/vcredist_x64.exe || exit /b 1
start /wait vcredist_x64.exe /q /norestart
del /q vcredist_x64.exe
)
)
yasm.exe --version || exit /b 1
)
where /q ninja.exe || (
echo Downloading ninja
pushd %DOWNLOAD%
if "%HOST_ARCH%" equ "x64" (
curl -Lsfo ninja-win.zip "https://github.com/ninja-build/ninja/releases/download/v%NINJA_VERSION%/ninja-win.zip" || exit /b 1
) else if "%HOST_ARCH%" equ "arm64" (
curl -Lsfo ninja-win.zip "https://github.com/ninja-build/ninja/releases/download/v%NINJA_VERSION%/ninja-winarm64.zip" || exit /b 1
)
%SZIP% x -bb0 -y ninja-win.zip 1>nul 2>nul || exit /b 1
popd
)
ninja.exe --version || exit /b 1
rem
rem Downloading & Unpacking
rem
call :get "https://github.com/madler/zlib/releases/download/v%ZLIB_VERSION%/zlib-%ZLIB_VERSION%.tar.xz" || exit /b 1
call :get "https://sourceware.org/pub/bzip2/bzip2-%BZIP2_VERSION%.tar.gz" || exit /b 1
call :get "https://github.com/tukaani-project/xz/releases/download/v%XZ_VERSION%/xz-%XZ_VERSION%.tar.xz" || exit /b 1
call :get "https://github.com/facebook/zstd/releases/download/v%ZSTD_VERSION%/zstd-%ZSTD_VERSION%.tar.gz" || exit /b 1
call :get "https://download.sourceforge.net/libpng/libpng-%LIBPNG_VERSION%.tar.xz" || exit /b 1
call :get "https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/%LIBJPEGTURBO_VERSION%/libjpeg-turbo-%LIBJPEGTURBO_VERSION%.tar.gz" || exit /b 1
call :get "https://www.cl.cam.ac.uk/~mgk25/jbigkit/download/jbigkit-%JBIG_VERSION%.tar.gz" || exit /b 1
call :get "https://github.com/Esri/lerc/archive/refs/tags/v%LERC_VERSION%.tar.gz" lerc-%LERC_VERSION%.tar.gz || exit /b 1
call :get "https://download.osgeo.org/libtiff/tiff-%TIFF_VERSION%.tar.gz" || exit /b 1
call :get "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-%LIBWEBP_VERSION%.tar.gz" || exit /b 1
call :get "https://storage.googleapis.com/aom-releases/libaom-%AOM_VERSION%.tar.gz" || exit /b 1
call :get "https://chromium.googlesource.com/libyuv/libyuv/+archive/%LIBYUV_VERSION%.tar.gz" libyuv-%LIBYUV_VERSION%.tar.gz %SOURCE%\libyuv-%LIBYUV_VERSION% || exit /b 1
call :get "https://downloads.videolan.org/pub/videolan/dav1d/%DAV1D_VERSION%/dav1d-%DAV1D_VERSION%.tar.xz" || exit /b 1
call :get "https://github.com/AOMediaCodec/libavif/archive/refs/tags/v%LIBAVIF_VERSION%.tar.gz" libavif-%LIBAVIF_VERSION%.tar.gz || exit /b 1
call :get "https://github.com/libjxl/libjxl/archive/refs/tags/v%LIBJXL_VERSION%.tar.gz" libjxl-%LIBJXL_VERSION%.tar.gz || exit /b 1
call :get "https://download.savannah.gnu.org/releases/freetype/freetype-%FREETYPE_VERSION%.tar.xz" || exit /b 1
call :get "https://github.com/harfbuzz/harfbuzz/releases/download/%HARFBUZZ_VERSION%/harfbuzz-%HARFBUZZ_VERSION%.tar.xz" || exit /b 1
call :get "https://downloads.xiph.org/releases/ogg/libogg-%LIBOGG_VERSION%.tar.xz" || exit /b 1
call :get "https://downloads.xiph.org/releases/vorbis/libvorbis-%LIBVORBIS_VERSION%.tar.xz" || exit /b 1
call :get "https://downloads.xiph.org/releases/opus/opus-%OPUS_VERSION%.tar.gz" || exit /b 1
call :get "https://downloads.xiph.org/releases/opus/opusfile-%OPUSFILE_VERSION%.tar.gz" || exit /b 1
call :get "https://downloads.xiph.org/releases/flac/flac-%FLAC_VERSION%.tar.xz" || exit /b 1
call :get "https://download.sourceforge.net/mpg123/mpg123-%MPG123_VERSION%.tar.bz2" || exit /b 1
call :get "https://github.com/libxmp/libxmp/releases/download/libxmp-%LIBXMP_VERSION%/libxmp-%LIBXMP_VERSION%.tar.gz" || exit /b 1
call :get "https://github.com/libgme/game-music-emu/archive/refs/tags/%LIBGME_VERSION%.tar.gz" libgme-%LIBGME_VERSION%.tar.gz || exit /b 1
call :get "https://github.com/dbry/WavPack/releases/download/%WAVPACK_VERSION%/wavpack-%WAVPACK_VERSION%.tar.xz" || exit /b 1
call :get "https://github.com/libsndfile/libsndfile/releases/download/%LIBSNDFILE_VERSION%/libsndfile-%LIBSNDFILE_VERSION%.tar.xz" || exit /b 1
rd /s /q %SOURCE%\libjxl-%LIBJXL_VERSION%\third_party\brotli 1>nul 2>nul
rd /s /q %SOURCE%\libjxl-%LIBJXL_VERSION%\third_party\highway 1>nul 2>nul
call :get "https://github.com/google/brotli/tarball/%BROTLI_COMMIT%" google-brotli-%BROTLI_COMMIT%.tar.gz || exit /b 1
call :get "https://github.com/google/highway/tarball/%HIGHWAY_COMMIT%" google-highway-%HIGHWAY_COMMIT%.tar.gz || exit /b 1
call :get "https://skia.googlesource.com/skcms/+archive/%SKCMS_COMMIT%.tar.gz" skcms-%SKCMS_COMMIT%.tar.gz %SOURCE%\libjxl-%LIBJXL_VERSION%\third_party\skcms || exit /b 1
move %SOURCE%\google-brotli-%BROTLI_COMMIT% %SOURCE%\libjxl-%LIBJXL_VERSION%\third_party\brotli 1>nul 2>nul
move %SOURCE%\google-highway-%HIGHWAY_COMMIT% %SOURCE%\libjxl-%LIBJXL_VERSION%\third_party\highway 1>nul 2>nul
call :clone SDL "https://github.com/libsdl-org/SDL" main || exit /b 1
call :clone SDL_image "https://github.com/libsdl-org/SDL_image" main || exit /b 1
call :clone SDL_mixer "https://github.com/libsdl-org/SDL_mixer" main || exit /b 1
call :clone SDL_ttf "https://github.com/libsdl-org/SDL_ttf" main || exit /b 1
call :clone SDL_rtf "https://github.com/libsdl-org/SDL_rtf" main || exit /b 1
call :clone SDL_net "https://github.com/libsdl-org/SDL_net" main || exit /b 1
call :clone SDL_shadercross "https://github.com/libsdl-org/SDL_shadercross" main || exit /b 1
call :clone SDL2_compat "https://github.com/libsdl-org/sdl2-compat" main || exit /b 1
echo Updating SDL_shadercross submodules
call git -C source\SDL_shadercross submodule update --init --recursive --quiet || exit /b 1
call git -C source\SDL_shadercross submodule foreach git reset --quiet --hard HEAD || exit /b 1
rem
rem apply patches
rem
call git apply -p1 --directory=source/SDL_shadercross patches/SDL_shadercross.patch || exit /b 1
call git apply -p1 --directory=source/SDL_shadercross/external/DirectXShaderCompiler patches/DirectXShaderCompiler.patch || exit /b 1
call git apply -p1 --directory=source/libyuv-%LIBYUV_VERSION% patches/libyuv.patch || exit /b 1
call git apply -p1 --directory=source/game-music-emu-%LIBGME_VERSION% patches/libgme.patch || exit /b 1
call git apply -p1 --directory=source/libjpeg-turbo-%LIBJPEGTURBO_VERSION% patches/libjpeg-turbo.patch || exit /b 1
call git apply -p1 --directory=source/flac-%FLAC_VERSION% patches/flac.patch || exit /b 1
rem
rem MSVC Environment
rem
set OLD_PATH=%PATH%
where /q cl.exe || (
for /f "tokens=*" %%i in ('"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath') do set VS=%%i
if "!VS!" equ "" (
echo ERROR: Visual Studio installation not found
exit /b 1
)
call "!VS!\Common7\Tools\VsDevCmd.bat" -arch=%TARGET_ARCH% -host_arch=%HOST_ARCH% -startdir=none -no_logo || exit /b 1
)
rem
rem Build Flags
rem
set CMAKE_COMMON_ARGS=-Wno-dev ^
-G Ninja ^
-D CMAKE_BUILD_TYPE="Release" ^
-D CMAKE_POLICY_DEFAULT_CMP0074=NEW ^
-D CMAKE_POLICY_DEFAULT_CMP0091=NEW ^
-D CMAKE_POLICY_DEFAULT_CMP0092=NEW ^
-D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
if "%TARGET_ARCH%" equ "arm64" (
set CMAKE_COMMON_ARGS=%CMAKE_COMMON_ARGS% ^
-DCMAKE_SYSTEM_NAME=Windows ^
-DCMAKE_SYSTEM_PROCESSOR=arm64
where /q clang-cl.exe || (
echo ERROR: "clang-cl.exe" not found, required to build "dav1d" and "libjxl" with neon intrinsic optimizations
exit /b 1
)
)
rem
rem zlib
rem
cmake.exe %CMAKE_COMMON_ARGS% ^
-S %SOURCE%\zlib-%ZLIB_VERSION% ^
-B %BUILD%\zlib-%ZLIB_VERSION% ^
-D CMAKE_INSTALL_PREFIX=%DEPEND% ^
-D BUILD_SHARED_LIBS=OFF ^
|| exit /b 1
ninja.exe -C %BUILD%\zlib-%ZLIB_VERSION% install || exit /b 1
del %DEPEND%\lib\zlib.lib 1>nul 2>nul
rem
rem bzip2
rem
if not exist %BUILD%\bzip2-%BZIP2_VERSION% mkdir %BUILD%\bzip2-%BZIP2_VERSION% || exit /b 1
pushd %BUILD%\bzip2-%BZIP2_VERSION%
cl.exe -nologo -c -MP -MT -O2 -DNDEBUG ^
%SOURCE%\bzip2-%BZIP2_VERSION%\blocksort.c ^
%SOURCE%\bzip2-%BZIP2_VERSION%\huffman.c ^
%SOURCE%\bzip2-%BZIP2_VERSION%\crctable.c ^
%SOURCE%\bzip2-%BZIP2_VERSION%\randtable.c ^
%SOURCE%\bzip2-%BZIP2_VERSION%\compress.c ^
%SOURCE%\bzip2-%BZIP2_VERSION%\decompress.c ^
%SOURCE%\bzip2-%BZIP2_VERSION%\bzlib.c ^
|| exit /b 1
lib.exe -nologo -out:libbz2.lib *.obj || exit /b 1
popd
copy /y %BUILD%\bzip2-%BZIP2_VERSION%\libbz2.lib %DEPEND%\lib\
copy /y %SOURCE%\bzip2-%BZIP2_VERSION%\bzlib.h %DEPEND%\include\
rem
rem xz
rem
cmake.exe %CMAKE_COMMON_ARGS% ^
-S %SOURCE%\xz-%XZ_VERSION% ^
-B %BUILD%\xz-%XZ_VERSION% ^
-D CMAKE_INSTALL_PREFIX=%DEPEND% ^
-D BUILD_SHARED_LIBS=OFF ^
|| exit /b 1
ninja.exe -C %BUILD%\xz-%XZ_VERSION% install || exit /b 1
rem
rem zstd
rem
cmake.exe %CMAKE_COMMON_ARGS% ^
-S %SOURCE%\zstd-%ZSTD_VERSION%\build\cmake ^
-B %BUILD%\zstd-%ZSTD_VERSION% ^
-D CMAKE_INSTALL_PREFIX=%DEPEND% ^
-D BUILD_SHARED_LIBS=OFF ^
-D ZSTD_BUILD_STATIC=ON ^
-D ZSTD_BUILD_SHARED=OFF ^
-D ZSTD_BUILD_PROGRAMS=OFF ^
-D ZSTD_BUILD_CONTRIB=OFF ^
-D ZSTD_BUILD_TESTS=OFF ^
-D ZSTD_LEGACY_SUPPORT=ON ^
-D ZSTD_MULTITHREAD_SUPPORT=ON ^
-D ZSTD_USE_STATIC_RUNTIME=ON ^
|| exit /b 1
ninja.exe -C %BUILD%\zstd-%ZSTD_VERSION% install || exit /b 1
rem
rem libpng
rem dependencies: zlib
rem
cmake.exe %CMAKE_COMMON_ARGS% ^
-S %SOURCE%\libpng-%LIBPNG_VERSION% ^
-B %BUILD%\libpng-%LIBPNG_VERSION% ^
-D CMAKE_INSTALL_PREFIX=%DEPEND% ^
-D PNG_STATIC=ON ^
-D PNG_SHARED=OFF ^
-D PNG_TESTS=OFF ^
-D PNG_TOOLS=OFF ^
-D PNG_DEBUG=OFF ^
-D PNG_HARDWARE_OPTIMIZATIONS=ON ^
|| exit /b 1
ninja.exe -C %BUILD%\libpng-%LIBPNG_VERSION% install || exit /b 1
rem
rem libjpeg-turbo
rem
if "%TARGET_ARCH%" equ "arm64" (
set LIBJPEG_TURBO_CMAKE_EXTRA=^
-D CPU_TYPE=arm64 ^
-D NEON_INTRINSICS=ON
)
cmake.exe %CMAKE_COMMON_ARGS% ^
-S %SOURCE%\libjpeg-turbo-%LIBJPEGTURBO_VERSION% ^
-B %BUILD%\libjpeg-turbo-%LIBJPEGTURBO_VERSION% ^
-D CMAKE_INSTALL_PREFIX=%DEPEND% ^
-D ENABLE_SHARED=OFF ^
-D ENABLE_STATIC=ON ^
-D REQUIRE_SIMD=ON ^
-D WITH_SIMD=ON ^
-D WITH_ARITH_DEC=ON ^
-D WITH_ARITH_ENC=ON ^
-D WITH_JPEG7=ON ^
-D WITH_JPEG8=ON ^
-D WITH_TURBOJPEG=OFF ^
-D WITH_JAVA=OFF ^
%LIBJPEG_TURBO_CMAKE_EXTRA% ^
|| exit /b 1
ninja.exe -C %BUILD%\libjpeg-turbo-%LIBJPEGTURBO_VERSION% install || exit /b 1
rem
rem libwebp
rem
cmake.exe %CMAKE_COMMON_ARGS% ^
-S %SOURCE%\libwebp-%LIBWEBP_VERSION% ^
-B %BUILD%\libwebp-%LIBWEBP_VERSION% ^
-D CMAKE_INSTALL_PREFIX=%DEPEND% ^
-D BUILD_SHARED_LIBS=OFF ^
-D WEBP_ENABLE_SIMD=ON ^
-D WEBP_BUILD_ANIM_UTILS=OFF ^
-D WEBP_BUILD_CWEBP=OFF ^
-D WEBP_BUILD_DWEBP=OFF ^
-D WEBP_BUILD_GIF2WEBP=OFF ^
-D WEBP_BUILD_IMG2WEBP=OFF ^
-D WEBP_BUILD_VWEBP=OFF ^
-D WEBP_BUILD_WEBPINFO=OFF ^
-D WEBP_BUILD_LIBWEBPMUX=OFF ^
-D WEBP_BUILD_WEBPMUX=OFF ^
-D WEBP_BUILD_EXTRAS=OFF ^
-D WEBP_BUILD_WEBP_JS=OFF ^
-D WEBP_USE_THREAD=ON ^
-D WEBP_NEAR_LOSSLESS=ON ^
|| exit /b 1
ninja.exe -C %BUILD%\libwebp-%LIBWEBP_VERSION% install || exit /b 1
rem
rem jbig
rem
if not exist %BUILD%\jbigkit-%JBIG_VERSION% mkdir %BUILD%\jbigkit-%JBIG_VERSION% || exit /b 1
pushd %BUILD%\jbigkit-%JBIG_VERSION%
cl.exe -nologo -c -MP -MT -O2 ^
%SOURCE%\jbigkit-%JBIG_VERSION%\libjbig\jbig.c ^
%SOURCE%\jbigkit-%JBIG_VERSION%\libjbig\jbig_ar.c ^
|| exit /b 1
lib.exe -nologo -out:jbig.lib *.obj || exit /b 1
popd
copy /y %BUILD%\jbigkit-%JBIG_VERSION%\jbig.lib %DEPEND%\lib\
copy /y %SOURCE%\jbigkit-%JBIG_VERSION%\libjbig\jbig.h %DEPEND%\include\
copy /y %SOURCE%\jbigkit-%JBIG_VERSION%\libjbig\jbig_ar.h %DEPEND%\include\
rem
rem lerc
rem
cmake.exe %CMAKE_COMMON_ARGS% ^
-S %SOURCE%\lerc-%LERC_VERSION% ^
-B %BUILD%\lerc-%LERC_VERSION% ^
-D CMAKE_INSTALL_PREFIX=%DEPEND% ^
-D BUILD_SHARED_LIBS=OFF ^
|| exit /b 1
ninja.exe -C %BUILD%\lerc-%LERC_VERSION% install || exit /b 1
rem
rem tiff
rem dependencies: libjpeg-turbo, libwebp, jbig, lerc, zstd, xz, zlib
rem
cmake.exe %CMAKE_COMMON_ARGS% ^
-S %SOURCE%\tiff-%TIFF_VERSION% ^
-B %BUILD%\tiff-%TIFF_VERSION% ^
-D CMAKE_INSTALL_PREFIX=%DEPEND% ^
-D CMAKE_C_FLAGS=-DLZMA_API_STATIC ^
-D BUILD_SHARED_LIBS=OFF ^
-D WebP_LIBRARY=%DEPEND%\lib\libwebp.lib ^
-D tiff-tools=OFF ^
-D tiff-tools-unsupported=OFF ^
-D tiff-tests=OFF ^
-D tiff-contrib=OFF ^
-D tiff-docs=OFF ^
-D tiff-deprecated=OFF ^
-D ccitt=ON ^
-D packbits=ON ^
-D lzw=ON ^
-D thunder=ON ^
-D next=ON ^
-D mdi=ON ^
-D zlib=ON ^
-D pixarlog=ON ^
-D jpeg=ON ^
-D jbig=ON ^
-D lerc=ON ^
-D lzma=ON ^
-D zstd=ON ^
-D webp=ON ^
|| exit /b 1
ninja.exe -C %BUILD%\tiff-%TIFF_VERSION% install || exit /b 1
call git apply -p1 --directory=depend-%TARGET_ARCH% patches/tiff.patch || exit /b 1
rem
rem aom
rem
cmake.exe %CMAKE_COMMON_ARGS% ^
-S %SOURCE%\libaom-%AOM_VERSION% ^
-B %BUILD%\libaom-%AOM_VERSION% ^
-D CMAKE_INSTALL_PREFIX=%DEPEND% ^
-D BUILD_SHARED_LIBS=OFF ^
-D ENABLE_EXAMPLES=OFF ^
-D ENABLE_TESTDATA=OFF ^
-D ENABLE_TESTS=OFF ^
-D ENABLE_TOOLS=OFF ^
-D ENABLE_DOCS=OFF ^
|| exit /b 1
ninja.exe -C %BUILD%\libaom-%AOM_VERSION% install || exit /b 1
rem
rem libyuv
rem
cmake.exe %CMAKE_COMMON_ARGS% ^
-S %SOURCE%\libyuv-%LIBYUV_VERSION% ^
-B %BUILD%\libyuv-%LIBYUV_VERSION% ^
-D CMAKE_INSTALL_PREFIX=%DEPEND% ^
-D TEST=OFF ^
|| exit /b 1
ninja.exe -C %BUILD%\libyuv-%LIBYUV_VERSION% yuv || exit /b 1
copy /Y %BUILD%\libyuv-%LIBYUV_VERSION%\yuv.lib %DEPEND%\lib\
xcopy /Y /E %SOURCE%\libyuv-%LIBYUV_VERSION%\include %DEPEND%\include\
rem
rem dav1d
rem
meson.exe setup --reconfigure ^
--prefix=%DEPEND% ^
--default-library=static ^
--buildtype=release ^
--cross-file "%~dp0meson-%TARGET_ARCH%.txt" ^
-Db_ndebug=true ^
-Db_vscrt=mt ^
-Denable_asm=true ^
-Denable_tools=false ^
-Denable_examples=false ^
-Denable_tests=false ^
-Denable_docs=false ^
-Dlogging=false ^
%DAV1D_MESON_EXTRA% ^
%BUILD%\dav1d-%DAV1D_VERSION% ^
%SOURCE%\dav1d-%DAV1D_VERSION% ^
|| exit /b 1
ninja.exe -C %BUILD%\dav1d-%DAV1D_VERSION% install || exit /b 1
rem
rem libavif
rem dependencies: dav1d, aom, libyuv, libsharpyuv (part of libwebp)
rem
cmake.exe %CMAKE_COMMON_ARGS% ^
-S %SOURCE%\libavif-%LIBAVIF_VERSION% ^
-B %BUILD%\libavif-%LIBAVIF_VERSION% ^
-D CMAKE_INSTALL_PREFIX=%DEPEND% ^
-D BUILD_SHARED_LIBS=OFF ^
-D AVIF_ENABLE_WERROR=OFF ^
-D AVIF_CODEC_AOM=SYSTEM ^
-D AVIF_CODEC_AOM_ENCODE=ON ^
-D AVIF_CODEC_AOM_DECODE=OFF ^
-D AVIF_CODEC_DAV1D=SYSTEM ^
-D AVIF_LIBSHARPYUV=SYSTEM ^
-D DAV1D_LIBRARIES=%DEPEND%\lib ^
-D DAV1D_LIBRARY=%DEPEND%\lib\libdav1d.a ^
-D LIBSHARPYUV_INCLUDE_DIR=%DEPEND%\include\webp ^
-D LIBSHARPYUV_LIBRARY=%DEPEND%\lib\libsharpyuv.lib ^
-D VCPKG_TARGET_TRIPLET=1 ^
|| exit /b 1
ninja.exe -C %BUILD%\libavif-%LIBAVIF_VERSION% install || exit /b 1
rem
rem libjxl
rem
set LIBJXL_EXTRA_CFLAGS=-w -DJXL_STATIC_DEFINE
if "%TARGET_ARCH%" equ "arm64" (
set LIBJXL_CMAKE_EXTRA=-DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe
set LIBJXL_EXTRA_CFLAGS=%LIBJXL_EXTRA_CFLAGS% --target=aarch64-win32-msvc
)
cmake.exe %CMAKE_COMMON_ARGS% ^
-S %SOURCE%\libjxl-%LIBJXL_VERSION% ^
-B %BUILD%\libjxl-%LIBJXL_VERSION% ^
-D CMAKE_INSTALL_PREFIX=%DEPEND% ^
-D CMAKE_C_FLAGS="%LIBJXL_EXTRA_CFLAGS%" ^
-D CMAKE_CXX_FLAGS="%LIBJXL_EXTRA_CFLAGS% -EHsc \"-D_STL_EXTRA_DISABLED_WARNINGS=4244 4267\"" ^
-D BUILD_SHARED_LIBS=OFF ^
-D BUILD_TESTING=OFF ^
-D JPEGXL_STATIC=ON ^
-D JPEGXL_WARNINGS_AS_ERRORS=OFF ^
-D JPEGXL_ENABLE_FUZZERS=OFF ^
-D JPEGXL_ENABLE_DEVTOOLS=OFF ^
-D JPEGXL_ENABLE_TOOLS=OFF ^
-D JPEGXL_ENABLE_JPEGLI=OFF ^
-D JPEGXL_ENABLE_DOXYGEN=OFF ^
-D JPEGXL_ENABLE_MANPAGES=OFF ^
-D JPEGXL_ENABLE_BENCHMARK=OFF ^
-D JPEGXL_ENABLE_EXAMPLES=OFF ^
-D JPEGXL_BUNDLE_LIBPNG=OFF ^
-D JPEGXL_ENABLE_JNI=OFF ^
-D JPEGXL_ENABLE_SJPEG=OFF ^
-D JPEGXL_ENABLE_OPENEXR=OFF ^
-D JPEGXL_ENABLE_SKCMS=ON ^
-D JPEGXL_ENABLE_VIEWERS=OFF ^
-D JPEGXL_ENABLE_TCMALLOC=OFF ^
-D JPEGXL_ENABLE_PLUGINS=OFF ^
-D JPEGXL_ENABLE_COVERAGE=OFF ^
-D JPEGXL_ENABLE_TRANSCODE_JPEG=OFF ^
-D JPEGXL_ENABLE_AVX512=ON ^
-D JPEGXL_ENABLE_AVX512_ZEN4=ON ^
%LIBJXL_CMAKE_EXTRA% ^
|| exit /b 1
ninja.exe -C %BUILD%\libjxl-%LIBJXL_VERSION% install || exit /b 1
rem
rem harfbuzz (dummy build, just to have dependency for freetype)
rem
cmake.exe %CMAKE_COMMON_ARGS% ^
-S %SOURCE%\harfbuzz-%HARFBUZZ_VERSION% ^
-B %BUILD%\harfbuzz-%HARFBUZZ_VERSION% ^
-D CMAKE_INSTALL_PREFIX=%DEPEND% ^
-D BUILD_SHARED_LIBS=OFF ^
-D HB_BUILD_SUBSET=OFF ^
-D HB_HAVE_FREETYPE=OFF ^
|| exit /b 1
ninja.exe -C %BUILD%\harfbuzz-%HARFBUZZ_VERSION% install || exit /b 1
rem
rem freetype
rem dependencies: zlib, bzip2, libpng, harfbuzz, brotli (part of libjxl)
rem
cmake.exe %CMAKE_COMMON_ARGS% ^
-S %SOURCE%\freetype-%FREETYPE_VERSION% ^
-B %BUILD%\freetype-%FREETYPE_VERSION% ^
-D CMAKE_INSTALL_PREFIX=%DEPEND% ^
-D BUILD_SHARED_LIBS=OFF ^
-D FT_REQUIRE_ZLIB=ON ^
-D FT_REQUIRE_BZIP2=ON ^
-D FT_REQUIRE_BROTLI=ON ^
-D FT_REQUIRE_PNG=ON ^
-D FT_REQUIRE_HARFBUZZ=ON ^
|| exit /b 1
ninja.exe -C %BUILD%\freetype-%FREETYPE_VERSION% install || exit /b 1
rem
rem harfbuzz
rem dependencies: freetype
rem
cmake.exe %CMAKE_COMMON_ARGS% ^
-S %SOURCE%\harfbuzz-%HARFBUZZ_VERSION% ^
-B %BUILD%\harfbuzz-%HARFBUZZ_VERSION% ^
-D CMAKE_INSTALL_PREFIX=%DEPEND% ^
-D BUILD_SHARED_LIBS=OFF ^
-D HB_BUILD_SUBSET=OFF ^
-D HB_HAVE_FREETYPE=ON ^
|| exit /b 1
ninja.exe -C %BUILD%\harfbuzz-%HARFBUZZ_VERSION% install || exit /b 1
rem
rem libogg
rem
cmake.exe %CMAKE_COMMON_ARGS% ^
-S %SOURCE%\libogg-%LIBOGG_VERSION% ^
-B %BUILD%\libogg-%LIBOGG_VERSION% ^
-D CMAKE_INSTALL_PREFIX=%DEPEND% ^
-D BUILD_SHARED_LIBS=OFF ^
-D BUILD_TESTING=OFF ^
-D INSTALL_DOCS=OFF ^
|| exit /b 1
ninja.exe -C %BUILD%\libogg-%LIBOGG_VERSION% install || exit /b 1
rem
rem libvorbis
rem dependencies: libogg
rem
cmake.exe %CMAKE_COMMON_ARGS% ^
-S %SOURCE%\libvorbis-%LIBVORBIS_VERSION% ^
-B %BUILD%\libvorbis-%LIBVORBIS_VERSION% ^
-D CMAKE_INSTALL_PREFIX=%DEPEND% ^
-D BUILD_SHARED_LIBS=OFF ^
|| exit /b 1
ninja.exe -C %BUILD%\libvorbis-%LIBVORBIS_VERSION% install || exit /b 1
rem
rem opus
rem dependencies: libogg
rem
cmake.exe %CMAKE_COMMON_ARGS% ^
-S %SOURCE%\opus-%OPUS_VERSION% ^
-B %BUILD%\opus-%OPUS_VERSION% ^
-D CMAKE_INSTALL_PREFIX=%DEPEND% ^
-D BUILD_SHARED_LIBS=OFF ^
-D OPUS_BUILD_SHARED_LIBRARY=OFF ^
-D OPUS_BUILD_TESTING=OFF ^
-D OPUS_BUILD_PROGRAMS=OFF ^
-D OPUS_ASSERTIONS=OFF ^
-D OPUS_HARDENING=OFF ^
-D OPUS_FUZZING=OFF ^
-D OPUS_CHECK_ASM=OFF ^
-D OPUS_DRED=OFF ^
-D OPUS_OSCE=OFF ^
-D OPUS_STATIC_RUNTIME=ON ^
-D OPUS_FAST_MATH=OFF ^
-D OPUS_STACK_PROTECTOR=OFF ^
-D OPUS_FORTIFY_SOURCE=OFF ^
|| exit /b 1
ninja.exe -C %BUILD%\opus-%OPUS_VERSION% install || exit /b 1
rem
rem opusfile
rem dependencies: opus
rem
if not exist %BUILD%\opusfile-%OPUSFILE_VERSION% mkdir %BUILD%\opusfile-%OPUSFILE_VERSION% || exit /b 1
pushd %BUILD%\opusfile-%OPUSFILE_VERSION%
cl.exe -nologo -c -MP -MT -O2 -DNDEBUG ^
-I%SOURCE%\opusfile-%OPUSFILE_VERSION%\include ^
-I%DEPEND%\include -I%DEPEND%\include\opus ^
%SOURCE%\opusfile-%OPUSFILE_VERSION%\src\info.c ^
%SOURCE%\opusfile-%OPUSFILE_VERSION%\src\internal.c ^
%SOURCE%\opusfile-%OPUSFILE_VERSION%\src\opusfile.c ^
%SOURCE%\opusfile-%OPUSFILE_VERSION%\src\stream.c ^
|| exit /b 1
lib.exe -nologo -out:opusfile.lib *.obj || exit /b 1
popd
copy /y %BUILD%\opusfile-%OPUSFILE_VERSION%\opusfile.lib %DEPEND%\lib\
copy /y %SOURCE%\opusfile-%OPUSFILE_VERSION%\include\opusfile.h %DEPEND%\include\opus\
rem
rem flac
rem dependencies: libogg
rem
cmake.exe %CMAKE_COMMON_ARGS% ^
-S %SOURCE%\flac-%FLAC_VERSION% ^
-B %BUILD%\flac-%FLAC_VERSION% ^
-D CMAKE_INSTALL_PREFIX=%DEPEND% ^
-D BUILD_SHARED_LIBS=OFF ^
-D BUILD_CXXLIBS=OFF ^
-D BUILD_PROGRAMS=OFF ^
-D BUILD_EXAMPLES=OFF ^
-D BUILD_TESTING=OFF ^
-D BUILD_DOCS=OFF ^
-D INSTALL_MANPAGES=OFF ^
-D WITH_FORTIFY_SOURCE=OFF ^
-D WITH_STACK_PROTECTOR=OFF ^
-D WITH_OGG=ON ^
-D WITH_AVX=ON ^
|| exit /b 1
ninja.exe -C %BUILD%\flac-%FLAC_VERSION% install || exit /b 1
rem
rem mpg123
rem
cmake.exe %CMAKE_COMMON_ARGS% ^
-S %SOURCE%\mpg123-%MPG123_VERSION%\ports\cmake ^
-B %BUILD%\mpg123-%MPG123_VERSION% ^
-D CMAKE_INSTALL_PREFIX=%DEPEND% ^
-D BUILD_SHARED_LIBS=OFF ^
-D BUILD_LIBOUT123=OFF ^
|| exit /b 1
ninja.exe -C %BUILD%\mpg123-%MPG123_VERSION% install || exit /b 1
rem
rem libxmp
rem
cmake.exe %CMAKE_COMMON_ARGS% ^
-S %SOURCE%\libxmp-%LIBXMP_VERSION% ^
-B %BUILD%\libxmp-%LIBXMP_VERSION% ^
-D CMAKE_INSTALL_PREFIX=%DEPEND% ^
-D BUILD_STATIC=ON ^
-D BUILD_SHARED=OFF ^
-D LIBXMP_DOCS=OFF ^
-D WITH_UNIT_TESTS=OFF ^
|| exit /b 1
ninja.exe -C %BUILD%\libxmp-%LIBXMP_VERSION% install || exit /b 1
rem
rem libgme
rem dependencies: zlib
rem
cmake.exe %CMAKE_COMMON_ARGS% ^
-S %SOURCE%\game-music-emu-%LIBGME_VERSION% ^
-B %BUILD%\game-music-emu-%LIBGME_VERSION% ^
-D CMAKE_IGNORE_PREFIX_PATH=%~dp0 ^
-D CMAKE_INSTALL_PREFIX=%DEPEND% ^
-D CMAKE_CXX_FLAGS=-DBLARGG_EXPORT= ^
-D BUILD_SHARED_LIBS=OFF ^
-D ENABLE_UBSAN=OFF ^
-D ZLIB_LIBRARY=%DEPEND%\lib\zlibstatic.lib ^
|| exit /b 1
ninja.exe -C %BUILD%\game-music-emu-%LIBGME_VERSION% install || exit /b 1
rem
rem wavpack
rem
if "%TARGET_ARCH%" equ "x64" (
set WAVPACK_EXTRA_CMAKE=-D CMAKE_ASM_COMPILER=ml64.exe -D WAVPACK_ENABLE_ASM=ON
) else (
set WAVPACK_EXTRA_CMAKE=-D WAVPACK_ENABLE_ASM=OFF
)
cmake.exe %CMAKE_COMMON_ARGS% ^
-S %SOURCE%\wavpack-%WAVPACK_VERSION% ^
-B %BUILD%\wavpack-%WAVPACK_VERSION% ^
-D CMAKE_INSTALL_PREFIX=%DEPEND% ^
%WAVPACK_EXTRA_CMAKE% ^
-D BUILD_SHARED_LIBS=OFF ^
-D BUILD_TESTING=OFF ^
-D WAVPACK_INSTALL_DOCS=OFF ^
-D WAVPACK_BUILD_PROGRAMS=OFF ^
-D WAVPACK_BUILD_COOLEDIT_PLUGIN=OFF ^
-D WAVPACK_BUILD_WINAMP_PLUGIN=OFF ^
|| exit /b 1
ninja.exe -C %BUILD%\wavpack-%WAVPACK_VERSION% install || exit /b 1
rem
rem libsndfile
rem
cmake.exe %CMAKE_COMMON_ARGS% ^
-S %SOURCE%\libsndfile-%LIBSNDFILE_VERSION% ^
-B %BUILD%\libsndfile-%LIBSNDFILE_VERSION% ^
-D CMAKE_INSTALL_PREFIX=%DEPEND% ^
-D BUILD_SHARED_LIBS=OFF ^
-D BUILD_PROGRAMS=OFF ^
-D BUILD_EXAMPLES=OFF ^
-D BUILD_TESTING=OFF ^
-D ENABLE_EXTERNAL_LIBS=OFF ^
-D ENABLE_MPEG=OFF ^
|| exit /b 1
ninja.exe -C %BUILD%\libsndfile-%LIBSNDFILE_VERSION% install || exit /b 1
rem
rem SDL
rem
cmake.exe %CMAKE_COMMON_ARGS% ^
-S %SOURCE%\SDL ^
-B %BUILD%\SDL ^
-D CMAKE_INSTALL_PREFIX=%OUTPUT% ^
-D BUILD_SHARED_LIBS=ON ^
|| exit /b 1
ninja.exe -C %BUILD%\SDL install || exit /b 1
rem
rem SDL_image
rem dependencies: avif, libjxl, tiff, libjpeg-turbo, libpng, libwebp
rem
set SDL3_IMAGE_LINK_FLAGS=-LIBPATH:%DEPEND%\lib brotlicommon.lib brotlidec.lib hwy.lib libsharpyuv.lib yuv.lib libdav1d.a aom.lib
cmake.exe %CMAKE_COMMON_ARGS% ^
-S %SOURCE%\SDL_image ^
-B %BUILD%\SDL_image ^
-D CMAKE_INSTALL_PREFIX=%OUTPUT% ^
-D CMAKE_PREFIX_PATH=%DEPEND% ^
-D CMAKE_C_FLAGS=-DJXL_STATIC_DEFINE ^
-D CMAKE_SHARED_LINKER_FLAGS="%SDL3_IMAGE_LINK_FLAGS%" ^
-D BUILD_SHARED_LIBS=ON ^
-D SDL3_ROOT=%OUTPUT% ^
-D SDLIMAGE_DEPS_SHARED=OFF ^
-D SDLIMAGE_VENDORED=OFF ^
-D SDLIMAGE_WERROR=OFF ^
-D SDLIMAGE_STRICT=ON ^
-D SDLIMAGE_SAMPLES=OFF ^
-D SDLIMAGE_TESTS=OFF ^
-D SDLIMAGE_BACKEND_STB=OFF ^
-D SDLIMAGE_BACKEND_WIC=OFF ^
-D SDLIMAGE_BACKEND_IMAGEIO=OFF ^
-D SDLIMAGE_AVIF=ON ^
-D SDLIMAGE_BMP=ON ^
-D SDLIMAGE_GIF=ON ^
-D SDLIMAGE_JPG=ON ^
-D SDLIMAGE_JXL=ON ^
-D SDLIMAGE_LBM=ON ^
-D SDLIMAGE_PCX=ON ^
-D SDLIMAGE_PNG=ON ^
-D SDLIMAGE_PNM=ON ^
-D SDLIMAGE_QOI=ON ^
-D SDLIMAGE_SVG=ON ^
-D SDLIMAGE_TGA=ON ^
-D SDLIMAGE_TIF=ON ^
-D SDLIMAGE_WEBP=ON ^
-D SDLIMAGE_XCF=ON ^
-D SDLIMAGE_XPM=ON ^
-D SDLIMAGE_XV=ON ^
-D SDLIMAGE_AVIF_SAVE=ON ^
-D SDLIMAGE_JPG_SAVE=ON ^
-D SDLIMAGE_PNG_SAVE=ON ^
|| exit /b 1
ninja.exe -C %BUILD%\SDL_image install || exit /b 1
rem
rem SDL_mixer
rem dependencies: libgme, libxmp, mpg123, flac, opusfile, vorbis, wavpack
rem
set SDL3_MIXER_LINK_FLAGS=-LIBPATH:%DEPEND%\lib zlibstatic.lib opus.lib
cmake.exe %CMAKE_COMMON_ARGS% ^
-S %SOURCE%\SDL_mixer ^
-B %BUILD%\SDL_mixer ^
-D CMAKE_INSTALL_PREFIX=%OUTPUT% ^
-D CMAKE_PREFIX_PATH=%DEPEND% ^
-D CMAKE_SHARED_LINKER_FLAGS="%SDL3_MIXER_LINK_FLAGS%" ^
-D BUILD_SHARED_LIBS=ON ^
-D SDL3_ROOT=%OUTPUT% ^
-D SDLMIXER_DEPS_SHARED=OFF ^
-D SDLMIXER_VENDORED=OFF ^
-D SDLMIXER_WERROR=OFF ^
-D SDLMIXER_SAMPLES=OFF ^
-D SDLMIXER_CMD=OFF ^
-D SDLMIXER_SNDFILE=ON ^
-D SDLMIXER_SNDFILE_SHARED=OFF ^
-D SDLMIXER_FLAC=ON ^
-D SDLMIXER_FLAC_LIBFLAC=ON ^
-D SDLMIXER_FLAC_LIBFLAC_SHARED=OFF ^
-D SDLMIXER_FLAC_DRFLAC=OFF ^
-D SDLMIXER_GME=ON ^
-D SDLMIXER_GME_SHARED=OFF ^
-D SDLMIXER_MOD=ON ^
-D SDLMIXER_MOD_MODPLUG=OFF ^
-D SDLMIXER_MOD_MODPLUG_SHARED=OFF ^
-D SDLMIXER_MOD_XMP=ON ^
-D SDLMIXER_MOD_XMP_LITE=OFF ^
-D SDLMIXER_MOD_XMP_SHARED=OFF ^
-D SDLMIXER_MP3=ON ^
-D SDLMIXER_MP3_MINIMP3=OFF ^
-D SDLMIXER_MP3_MPG123=ON ^
-D SDLMIXER_MP3_MPG123_SHARED=OFF ^
-D SDLMIXER_MIDI=ON ^
-D SDLMIXER_MIDI_FLUIDSYNTH=OFF ^
-D SDLMIXER_MIDI_FLUIDSYNTH_SHARED=OFF ^
-D SDLMIXER_MIDI_NATIVE=ON ^
-D SDLMIXER_MIDI_TIMIDITY=OFF ^
-D SDLMIXER_OPUS=ON ^
-D SDLMIXER_OPUS_SHARED=OFF ^
-D SDLMIXER_VORBIS="VORBISFILE" ^
-D SDLMIXER_VORBIS_TREMOR_SHARED=OFF ^
-D SDLMIXER_VORBIS_VORBISFILE_SHARED=OFF ^
-D SDLMIXER_WAVE=ON ^
-D SDLMIXER_WAVPACK=ON ^
-D SDLMIXER_WAVPACK_DSD=ON ^
-D SDLMIXER_WAVPACK_SHARED=OFF ^
|| exit /b 1
ninja.exe -C %BUILD%\SDL_mixer install || exit /b 1
rem
rem SDL_ttf
rem dependencies: freetype, harfbuzz
rem
set SDL3_TTF_LINK_FLAGS=-LIBPATH:%DEPEND%\lib brotlicommon.lib brotlidec.lib libbz2.lib zlibstatic.lib libpng16_static.lib
cmake.exe %CMAKE_COMMON_ARGS% ^
-S %SOURCE%\SDL_ttf ^
-B %BUILD%\SDL_ttf ^
-D CMAKE_INSTALL_PREFIX=%OUTPUT% ^
-D CMAKE_PREFIX_PATH=%DEPEND% ^
-D CMAKE_SHARED_LINKER_FLAGS="%SDL3_TTF_LINK_FLAGS%" ^
-D BUILD_SHARED_LIBS=ON ^
-D SDL3_ROOT=%OUTPUT% ^
-D SDLTTF_VENDORED=OFF ^
-D SDLTTF_WERROR=OFF ^
-D SDLTTF_SAMPLES=OFF ^
-D SDLTTF_FREETYPE=ON ^
-D SDLTTF_HARFBUZZ=ON ^
|| exit /b 1
ninja.exe -C %BUILD%\SDL_ttf install || exit /b 1