forked from lwthiker/curl-impersonate
-
-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathbuild.bat
79 lines (67 loc) · 2.48 KB
/
build.bat
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
@echo off
set "PATH=%PATH:LLVM=Dummy%"
IF EXIST "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\%1.bat" (
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\%1.bat"
) ELSE (
call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\%1.bat"
)
:: common dirs
set deps=%cd%\deps
set build=%cd%\build
set packages=%cd%\packages
:: configuration
set configuration=Release
set cmake_common_args=-GNinja -DCMAKE_BUILD_TYPE=%configuration%^
-DCMAKE_PREFIX_PATH="%packages%" -DCMAKE_INSTALL_PREFIX="%packages%"^
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded^
-DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe -DCMAKE_LINKER=link.exe
:: Build & Install zlib
pushd "%deps%\zlib"
cmake %cmake_common_args% -S . -B "%build%\zlib"
cmake --build "%build%\zlib" --config %configuration% --target install
move /y "%packages%\lib\zlibstatic.lib" "%packages%\lib\zlib.lib"
popd
:: Build & Install zstd
pushd "%deps%\zstd"
cmake %cmake_common_args% -DZSTD_BUILD_SHARED=OFF -S build\cmake -B "%build%\zstd"
cmake --build "%build%\zstd" --config %configuration% --target install
ren "%packages%\lib\zstd_static.lib" zstd.lib
popd
:: Build & Install brotli
pushd "%deps%\brotli"
cmake %cmake_common_args% -DBUILD_SHARED_LIBS=OFF -S . -B "%build%\brotli"
cmake --build "%build%\brotli" --config %configuration% --target install
popd
:: Build & Install nghttp2
pushd "%deps%\nghttp2"
cmake %cmake_common_args% -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -S . -B "%build%\nghttp2"
cmake --build "%build%\nghttp2" --config %configuration% --target install
popd
:: Build & Install boringssl
pushd "%deps%\boringssl"
cmake %cmake_common_args% -DCMAKE_POSITION_INDEPENDENT_CODE=ON -S . -B "%build%\boringssl"
cmake --build "%build%\boringssl" --config %configuration% --target install
popd
:: Build & Install curl
pushd "%deps%\curl"
cmake %cmake_common_args% -DBUILD_SHARED_LIBS=ON^
-DBUILD_STATIC_LIBS=ON^
-DBUILD_STATIC_CURL=ON^
-DCURL_USE_OPENSSL=ON^
-DCURL_BROTLI=ON^
-DCURL_ZSTD=ON^
-DUSE_ZLIB=ON^
-DUSE_WIN32_IDN=ON^
-DUSE_NGHTTP2=ON^
-DHAVE_ECH=1^
-DUSE_ECH=ON^
-DENABLE_WEBSOCKETS=ON^
-DDENABLE_IPV6=ON^
-DENABLE_UNICODE=ON^
-DCURL_ENABLE_SSL=ON^
-DCURL_USE_LIBSSH2=OFF^
"-DCMAKE_C_FLAGS=/DNGHTTP2_STATICLIB=1 /Dstrtok_r=strtok_s"^
-S . -B "%build%\curl"
cmake --build "%build%\curl" --config %configuration% --target install
popd
copy .\chrome\*.bat .\packages\bin /Y