@@ -26,106 +26,109 @@ IF %errorlevel% NEQ 0 (
2626 exit /b %errorlevel%
2727)
2828
29- if not exist " zlib" (
30- git clone https://github.com/madler/zlib.git
31- cd zlib
32- git checkout v1.3.1
33- cd contrib\vstudio\vc14
34- msbuild zlibstat.vcxproj /p:Configuration=ReleaseWithoutAsm /p:platform=x64 -p:PlatformToolset=v142
35-
29+ echo Installing nasm...
30+ choco install -y nasm
31+ where nasm
32+ SET PATH = %PATH% ;C:\Program Files\NASM
3633IF %errorlevel% NEQ 0 (
37- echo Can't install zlib
34+ echo Can't install nasm
3835 exit /b %errorlevel%
3936)
40- cd ..\..\..\..
41- ) else (
42- echo Using zlib...
43- )
4437
45- if not exist " lz4" (
46- git clone https://github.com/lz4/lz4.git
47- cd lz4
48- git checkout v1.9.4
49- cd build\VS2017\liblz4
50- msbuild liblz4.vcxproj /p:Configuration=Release /p:platform=x64 -p:PlatformToolset=v142
38+ mkdir third_libs
39+ cd third_libs
5140
52- IF %errorlevel% NEQ 0 (
53- echo Can't install lz4
54- exit /b %errorlevel%
55- )
56- cd ..\..\..\..
41+ set third_libs = %cd%
42+ echo %third_libs%
43+
44+ if not exist " zlib" (
45+ git clone https://github.com/madler/zlib.git
46+ cd zlib
47+ git checkout v1.3.1
48+ cd contrib\vstudio\vc14
49+ msbuild zlibstat.vcxproj /p:Configuration=ReleaseWithoutAsm /p:platform=x64 -p:PlatformToolset=v142
50+ cd ..\..\..\..
5751) else (
58- echo Using lz4 ...
52+ echo Using zlib ...
5953)
6054
61- curl --retry 5 --retry-delay 10 -Lo libsodium-1.0.18-stable-msvc.zip https://download.libsodium.org/libsodium/releases/libsodium-1.0.18-stable-msvc.zip
62- IF %errorlevel% NEQ 0 (
63- echo Can't download libsodium
64- exit /b %errorlevel%
65- )
66- unzip libsodium-1.0.18-stable-msvc.zip
55+ if not exist " lz4" (
56+ git clone https://github.com/lz4/lz4.git
57+ cd lz4
58+ git checkout v1.9.4
59+ cd build\VS2017\liblz4
60+ msbuild liblz4.vcxproj /p:Configuration=Release /p:platform=x64 -p:PlatformToolset=v142
61+ cd ..\..\..\..
6762) else (
68- echo Using libsodium ...
63+ echo Using lz4 ...
6964)
7065
71- if not exist " openssl-3.1.4" (
72- curl -Lo openssl-3.1.4.zip https://github.com/neodiX42/precompiled-openssl-win64/raw/main/openssl-3.1.4.zip
73- IF %errorlevel% NEQ 0 (
74- echo Can't download OpenSSL
75- exit /b %errorlevel%
76- )
77- unzip -q openssl-3.1.4.zip
66+ if not exist " libsodium" (
67+ git clone https://github.com/jedisct1/libsodium
68+ cd libsodium
69+ git checkout 1.0.18-RELEASE
70+ msbuild libsodium.vcxproj /p:Configuration=Release /p:platform=x64 -p:PlatformToolset=v142
71+ cd ..
7872) else (
79- echo Using openssl ...
73+ echo Using libsodium ...
8074)
8175
82- if not exist " libmicrohttpd-0.9.77-w32-bin" (
83- curl -Lo libmicrohttpd-0.9.77-w32-bin.zip https://github.com/neodiX42/precompiled-openssl-win64/raw/main/libmicrohttpd-0.9.77-w32-bin.zip
84- IF %errorlevel% NEQ 0 (
85- echo Can't download libmicrohttpd
86- exit /b %errorlevel%
87- )
88- unzip -q libmicrohttpd-0.9.77-w32-bin.zip
76+ if not exist " openssl" (
77+ git clone https://github.com/openssl/openssl.git
78+ cd openssl
79+ git checkout openssl-3.1.4
80+ where perl
81+ perl Configure VC-WIN64A
82+ IF %errorlevel% NEQ 0 (
83+ echo Can't configure openssl
84+ exit /b %errorlevel%
85+ )
86+ nmake
87+ cd ..
8988) else (
90- echo Using libmicrohttpd ...
89+ echo Using openssl ...
9190)
9291
93- if not exist " readline-5.0-1-lib" (
94- curl -Lo readline-5.0-1-lib.zip https://github.com/neodiX42/precompiled-openssl-win64/raw/main/readline-5.0-1-lib.zip
95- IF %errorlevel% NEQ 0 (
96- echo Can't download readline
97- exit /b %errorlevel%
98- )
99- unzip -q -d readline-5.0-1-lib readline-5.0-1-lib.zip
92+ if not exist " libmicrohttpd" (
93+ git clone https://github.com/Karlson2k/libmicrohttpd.git
94+ cd libmicrohttpd
95+ git checkout v1.0.1
96+ cd w32\VS2019
97+ msbuild libmicrohttpd.vcxproj /p:Configuration=Release-static /p:platform=x64 -p:PlatformToolset=v142
98+ IF %errorlevel% NEQ 0 (
99+ echo Can't compile libmicrohttpd
100+ exit /b %errorlevel%
101+ )
102+ cd ../../..
100103) else (
101- echo Using readline ...
104+ echo Using libmicrohttpd ...
102105)
103106
104-
105- set root = %cd%
106- echo %root%
107- set SODIUM_DIR = %root% \libsodium
107+ cd ..
108+ echo Current dir %cd%
108109
109110mkdir build
110111cd build
111112cmake -GNinja -DCMAKE_BUILD_TYPE=Release ^
112113-DPORTABLE=1 ^
113114-DSODIUM_USE_STATIC_LIBS=1 ^
115+ -DSODIUM_LIBRARY_RELEASE=%third_libs% \libsodium\Build\Release\x64\libsodium.lib ^
116+ -DSODIUM_LIBRARY_DEBUG=%third_libs% \libsodium\Build\Release\x64\libsodium.lib ^
117+ -DSODIUM_INCLUDE_DIR=%third_libs% \libsodium\src\libsodium\include ^
114118-DLZ4_FOUND=1 ^
115- -DLZ4_INCLUDE_DIRS=%root % \lz4\lib ^
116- -DLZ4_LIBRARIES=%root % \lz4\build\VS2017\liblz4\bin\x64_Release\liblz4_static.lib ^
119+ -DLZ4_INCLUDE_DIRS=%third_libs % \lz4\lib ^
120+ -DLZ4_LIBRARIES=%third_libs % \lz4\build\VS2017\liblz4\bin\x64_Release\liblz4_static.lib ^
117121-DMHD_FOUND=1 ^
118- -DMHD_LIBRARY=%root % \libmicrohttpd-0.9.77- w32-bin\x86_64\ VS2019\Release-static \libmicrohttpd.lib ^
119- -DMHD_INCLUDE_DIR=%root % \libmicrohttpd-0.9.77-w32-bin\x86_64\VS2019\Release-static ^
122+ -DMHD_LIBRARY=%third_libs % \libmicrohttpd\ w32\ VS2019\Output\x64 \libmicrohttpd.lib ^
123+ -DMHD_INCLUDE_DIR=%third_libs % \libmicrohttpd\src\include ^
120124-DZLIB_FOUND=1 ^
121- -DZLIB_INCLUDE_DIR=%root % \zlib ^
122- -DZLIB_LIBRARIES=%root % \zlib\contrib\vstudio\vc14\x64\ZlibStatReleaseWithoutAsm\zlibstat.lib ^
125+ -DZLIB_INCLUDE_DIR=%third_libs % \zlib ^
126+ -DZLIB_LIBRARIES=%third_libs % \zlib\contrib\vstudio\vc14\x64\ZlibStatReleaseWithoutAsm\zlibstat.lib ^
123127-DOPENSSL_FOUND=1 ^
124- -DOPENSSL_INCLUDE_DIR=%root% \openssl-3.1.4\x64\include ^
125- -DOPENSSL_CRYPTO_LIBRARY=%root% \openssl-3.1.4\x64\lib\libcrypto_static.lib ^
126- -DREADLINE_INCLUDE_DIR=%root% \readline-5.0-1-lib\include ^
127- -DREADLINE_LIBRARY=%root% \readline-5.0-1-lib\lib\readline.lib ^
128+ -DOPENSSL_INCLUDE_DIR=%third_libs% \openssl\include ^
129+ -DOPENSSL_CRYPTO_LIBRARY=%third_libs% \openssl\libcrypto_static.lib ^
128130-DCMAKE_CXX_FLAGS=" /DTD_WINDOWS=1 /EHsc /bigobj" ..
131+
129132IF %errorlevel% NEQ 0 (
130133 echo Can't configure TON
131134 exit /b %errorlevel%
@@ -168,33 +171,38 @@ REM ctest -C Release --output-on-failure -E "test-catchain|test-actors|test-val
168171 )
169172)
170173
171-
172- echo Creating artifacts...
174+ echo Strip and copy artifacts
173175cd ..
176+ echo where strip
177+ where strip
174178mkdir artifacts
175179mkdir artifacts\smartcont
176180mkdir artifacts\lib
177181
178182for %%I in (build\storage\storage-daemon\storage-daemon.exe ^
179- build\storage\storage-daemon\storage-daemon-cli.exe ^
180- build\blockchain-explorer\blockchain-explorer.exe ^
181- build\crypto\fift.exe ^
182- build\crypto\tlbc.exe ^
183- build\crypto\func.exe ^
184- build\tolk\tolk.exe ^
185- build\crypto\create-state.exe ^
186- build\validator-engine-console\validator-engine-console.exe ^
187- build\tonlib\tonlib-cli.exe ^
188- build\tonlib\tonlibjson.dll ^
189- build\http\http-proxy.exe ^
190- build\rldp-http-proxy\rldp-http-proxy.exe ^
191- build\dht-server\dht-server.exe ^
192- build\lite-client\lite-client.exe ^
193- build\validator-engine\validator-engine.exe ^
194- build\utils\generate-random-id.exe ^
195- build\utils\json2tlo.exe ^
196- build\utils\proxy-liteserver.exe ^
197- build\adnl\adnl-proxy.exe ^
198- build\emulator\emulator.dll) do (strip -s %%I & copy %%I artifacts\)
183+ build\storage\storage-daemon\storage-daemon-cli.exe ^
184+ build\blockchain-explorer\blockchain-explorer.exe ^
185+ build\crypto\fift.exe ^
186+ build\crypto\tlbc.exe ^
187+ build\crypto\func.exe ^
188+ build\tolk\tolk.exe ^
189+ build\crypto\create-state.exe ^
190+ build\validator-engine-console\validator-engine-console.exe ^
191+ build\tonlib\tonlib-cli.exe ^
192+ build\tonlib\tonlibjson.dll ^
193+ build\http\http-proxy.exe ^
194+ build\rldp-http-proxy\rldp-http-proxy.exe ^
195+ build\dht-server\dht-server.exe ^
196+ build\lite-client\lite-client.exe ^
197+ build\validator-engine\validator-engine.exe ^
198+ build\utils\generate-random-id.exe ^
199+ build\utils\json2tlo.exe ^
200+ build\utils\proxy-liteserver.exe ^
201+ build\adnl\adnl-proxy.exe ^
202+ build\emulator\emulator.dll) do (
203+ echo strip -s %%I & copy %%I artifacts\
204+ strip -s %%I & copy %%I artifacts\
205+ )
206+
199207xcopy /e /k /h /i crypto\smartcont artifacts\smartcont
200208xcopy /e /k /h /i crypto\fift\lib artifacts\lib
0 commit comments