2024-06-24 14:09:25 +00:00
|
|
|
REM execute this script inside elevated (Run as Administrator) console "x64 Native Tools Command Prompt for VS 2019"
|
|
|
|
|
|
|
|
echo off
|
|
|
|
|
|
|
|
echo Installing chocolatey windows package manager...
|
|
|
|
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
|
|
|
|
choco -?
|
|
|
|
IF %errorlevel% NEQ 0 (
|
|
|
|
echo Can't install chocolatey
|
|
|
|
exit /b %errorlevel%
|
|
|
|
)
|
|
|
|
|
|
|
|
choco feature enable -n allowEmptyChecksums
|
|
|
|
|
|
|
|
echo Installing pkgconfiglite...
|
|
|
|
choco install -y pkgconfiglite
|
|
|
|
IF %errorlevel% NEQ 0 (
|
|
|
|
echo Can't install pkgconfiglite
|
|
|
|
exit /b %errorlevel%
|
|
|
|
)
|
|
|
|
|
|
|
|
echo Installing ninja...
|
|
|
|
choco install -y ninja
|
|
|
|
IF %errorlevel% NEQ 0 (
|
|
|
|
echo Can't install ninja
|
|
|
|
exit /b %errorlevel%
|
|
|
|
)
|
|
|
|
|
2024-12-11 11:41:45 +00:00
|
|
|
echo Installing nasm...
|
|
|
|
choco install -y nasm
|
|
|
|
where nasm
|
|
|
|
SET PATH=%PATH%;C:\Program Files\NASM
|
2024-06-24 14:09:25 +00:00
|
|
|
IF %errorlevel% NEQ 0 (
|
2024-12-11 11:41:45 +00:00
|
|
|
echo Can't install nasm
|
2024-06-24 14:09:25 +00:00
|
|
|
exit /b %errorlevel%
|
|
|
|
)
|
|
|
|
|
2024-12-11 11:41:45 +00:00
|
|
|
mkdir third_libs
|
|
|
|
cd third_libs
|
2024-06-24 14:09:25 +00:00
|
|
|
|
2024-12-11 11:41:45 +00:00
|
|
|
set third_libs=%cd%
|
|
|
|
echo %third_libs%
|
|
|
|
|
|
|
|
if not exist "zlib" (
|
|
|
|
git clone https://github.com/madler/zlib.git
|
|
|
|
cd zlib
|
|
|
|
git checkout v1.3.1
|
|
|
|
cd contrib\vstudio\vc14
|
|
|
|
msbuild zlibstat.vcxproj /p:Configuration=ReleaseWithoutAsm /p:platform=x64 -p:PlatformToolset=v142
|
|
|
|
cd ..\..\..\..
|
2024-06-24 14:09:25 +00:00
|
|
|
) else (
|
2024-12-11 11:41:45 +00:00
|
|
|
echo Using zlib...
|
2024-06-24 14:09:25 +00:00
|
|
|
)
|
|
|
|
|
2024-12-11 11:41:45 +00:00
|
|
|
if not exist "lz4" (
|
|
|
|
git clone https://github.com/lz4/lz4.git
|
|
|
|
cd lz4
|
|
|
|
git checkout v1.9.4
|
|
|
|
cd build\VS2017\liblz4
|
|
|
|
msbuild liblz4.vcxproj /p:Configuration=Release /p:platform=x64 -p:PlatformToolset=v142
|
|
|
|
cd ..\..\..\..
|
2024-06-24 14:09:25 +00:00
|
|
|
) else (
|
2024-12-11 11:41:45 +00:00
|
|
|
echo Using lz4...
|
2024-06-24 14:09:25 +00:00
|
|
|
)
|
|
|
|
|
2024-12-11 11:41:45 +00:00
|
|
|
if not exist "libsodium" (
|
|
|
|
git clone https://github.com/jedisct1/libsodium
|
|
|
|
cd libsodium
|
|
|
|
git checkout 1.0.18-RELEASE
|
|
|
|
msbuild libsodium.vcxproj /p:Configuration=Release /p:platform=x64 -p:PlatformToolset=v142
|
|
|
|
cd ..
|
2024-06-24 14:09:25 +00:00
|
|
|
) else (
|
2024-12-11 11:41:45 +00:00
|
|
|
echo Using libsodium...
|
2024-06-24 14:09:25 +00:00
|
|
|
)
|
|
|
|
|
2024-12-11 11:41:45 +00:00
|
|
|
if not exist "openssl" (
|
|
|
|
git clone https://github.com/openssl/openssl.git
|
|
|
|
cd openssl
|
|
|
|
git checkout openssl-3.1.4
|
|
|
|
where perl
|
|
|
|
perl Configure VC-WIN64A
|
|
|
|
IF %errorlevel% NEQ 0 (
|
|
|
|
echo Can't configure openssl
|
|
|
|
exit /b %errorlevel%
|
|
|
|
)
|
|
|
|
nmake
|
|
|
|
cd ..
|
2024-06-24 14:09:25 +00:00
|
|
|
) else (
|
2024-12-11 11:41:45 +00:00
|
|
|
echo Using openssl...
|
2024-06-24 14:09:25 +00:00
|
|
|
)
|
|
|
|
|
2024-12-11 11:41:45 +00:00
|
|
|
if not exist "libmicrohttpd" (
|
|
|
|
git clone https://github.com/Karlson2k/libmicrohttpd.git
|
|
|
|
cd libmicrohttpd
|
|
|
|
git checkout v1.0.1
|
|
|
|
cd w32\VS2019
|
|
|
|
msbuild libmicrohttpd.vcxproj /p:Configuration=Release-static /p:platform=x64 -p:PlatformToolset=v142
|
|
|
|
IF %errorlevel% NEQ 0 (
|
|
|
|
echo Can't compile libmicrohttpd
|
|
|
|
exit /b %errorlevel%
|
|
|
|
)
|
|
|
|
cd ../../..
|
2024-06-24 14:09:25 +00:00
|
|
|
) else (
|
2024-12-11 11:41:45 +00:00
|
|
|
echo Using libmicrohttpd...
|
2024-06-24 14:09:25 +00:00
|
|
|
)
|
|
|
|
|
2024-12-11 11:41:45 +00:00
|
|
|
cd ..
|
|
|
|
echo Current dir %cd%
|
2024-06-24 14:09:25 +00:00
|
|
|
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
cmake -GNinja -DCMAKE_BUILD_TYPE=Release ^
|
|
|
|
-DPORTABLE=1 ^
|
|
|
|
-DSODIUM_USE_STATIC_LIBS=1 ^
|
2024-12-11 11:41:45 +00:00
|
|
|
-DSODIUM_LIBRARY_RELEASE=%third_libs%\libsodium\Build\Release\x64\libsodium.lib ^
|
|
|
|
-DSODIUM_LIBRARY_DEBUG=%third_libs%\libsodium\Build\Release\x64\libsodium.lib ^
|
|
|
|
-DSODIUM_INCLUDE_DIR=%third_libs%\libsodium\src\libsodium\include ^
|
2024-06-24 14:09:25 +00:00
|
|
|
-DLZ4_FOUND=1 ^
|
2024-12-11 11:41:45 +00:00
|
|
|
-DLZ4_INCLUDE_DIRS=%third_libs%\lz4\lib ^
|
|
|
|
-DLZ4_LIBRARIES=%third_libs%\lz4\build\VS2017\liblz4\bin\x64_Release\liblz4_static.lib ^
|
2024-06-24 14:09:25 +00:00
|
|
|
-DMHD_FOUND=1 ^
|
2024-12-11 11:41:45 +00:00
|
|
|
-DMHD_LIBRARY=%third_libs%\libmicrohttpd\w32\VS2019\Output\x64\libmicrohttpd.lib ^
|
|
|
|
-DMHD_INCLUDE_DIR=%third_libs%\libmicrohttpd\src\include ^
|
2024-06-24 14:09:25 +00:00
|
|
|
-DZLIB_FOUND=1 ^
|
2024-12-11 11:41:45 +00:00
|
|
|
-DZLIB_INCLUDE_DIR=%third_libs%\zlib ^
|
|
|
|
-DZLIB_LIBRARIES=%third_libs%\zlib\contrib\vstudio\vc14\x64\ZlibStatReleaseWithoutAsm\zlibstat.lib ^
|
2024-06-24 14:09:25 +00:00
|
|
|
-DOPENSSL_FOUND=1 ^
|
2024-12-11 11:41:45 +00:00
|
|
|
-DOPENSSL_INCLUDE_DIR=%third_libs%\openssl\include ^
|
|
|
|
-DOPENSSL_CRYPTO_LIBRARY=%third_libs%\openssl\libcrypto_static.lib ^
|
2024-06-24 14:09:25 +00:00
|
|
|
-DCMAKE_CXX_FLAGS="/DTD_WINDOWS=1 /EHsc /bigobj" ..
|
2024-12-11 11:41:45 +00:00
|
|
|
|
2024-06-24 14:09:25 +00:00
|
|
|
IF %errorlevel% NEQ 0 (
|
|
|
|
echo Can't configure TON
|
|
|
|
exit /b %errorlevel%
|
|
|
|
)
|
|
|
|
|
|
|
|
IF "%1"=="-t" (
|
2024-10-31 06:51:07 +00:00
|
|
|
ninja storage-daemon storage-daemon-cli blockchain-explorer fift func tolk tonlib tonlibjson ^
|
2024-06-24 14:09:25 +00:00
|
|
|
tonlib-cli validator-engine lite-client pow-miner validator-engine-console generate-random-id ^
|
|
|
|
json2tlo dht-server http-proxy rldp-http-proxy adnl-proxy create-state create-hardfork emulator ^
|
|
|
|
test-ed25519 test-ed25519-crypto test-bigint test-vm test-fift test-cells test-smartcont test-net ^
|
|
|
|
test-tdactor test-tdutils test-tonlib-offline test-adnl test-dht test-rldp test-rldp2 test-catchain ^
|
2024-12-03 07:03:14 +00:00
|
|
|
test-fec test-tddb test-db test-validator-session-state test-emulator proxy-liteserver
|
2024-06-24 14:09:25 +00:00
|
|
|
IF %errorlevel% NEQ 0 (
|
|
|
|
echo Can't compile TON
|
|
|
|
exit /b %errorlevel%
|
|
|
|
)
|
|
|
|
) else (
|
2024-10-31 06:51:07 +00:00
|
|
|
ninja storage-daemon storage-daemon-cli blockchain-explorer fift func tolk tonlib tonlibjson ^
|
2024-06-24 14:09:25 +00:00
|
|
|
tonlib-cli validator-engine lite-client pow-miner validator-engine-console generate-random-id ^
|
2024-12-03 07:03:14 +00:00
|
|
|
json2tlo dht-server http-proxy rldp-http-proxy adnl-proxy create-state create-hardfork emulator proxy-liteserver
|
2024-06-24 14:09:25 +00:00
|
|
|
IF %errorlevel% NEQ 0 (
|
|
|
|
echo Can't compile TON
|
|
|
|
exit /b %errorlevel%
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
copy validator-engine\validator-engine.exe test
|
|
|
|
IF %errorlevel% NEQ 0 (
|
|
|
|
echo validator-engine.exe does not exist
|
|
|
|
exit /b %errorlevel%
|
|
|
|
)
|
|
|
|
|
|
|
|
IF "%1"=="-t" (
|
|
|
|
echo Running tests...
|
|
|
|
REM ctest -C Release --output-on-failure -E "test-catchain|test-actors|test-validator-session-state"
|
|
|
|
ctest -C Release --output-on-failure -E "test-bigint" --timeout 1800
|
|
|
|
IF %errorlevel% NEQ 0 (
|
|
|
|
echo Some tests failed
|
|
|
|
exit /b %errorlevel%
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2024-12-11 11:41:45 +00:00
|
|
|
echo Strip and copy artifacts
|
2024-06-24 14:09:25 +00:00
|
|
|
cd ..
|
2024-12-11 11:41:45 +00:00
|
|
|
echo where strip
|
|
|
|
where strip
|
2024-06-24 14:09:25 +00:00
|
|
|
mkdir artifacts
|
|
|
|
mkdir artifacts\smartcont
|
|
|
|
mkdir artifacts\lib
|
|
|
|
|
|
|
|
for %%I in (build\storage\storage-daemon\storage-daemon.exe ^
|
2024-12-11 11:41:45 +00:00
|
|
|
build\storage\storage-daemon\storage-daemon-cli.exe ^
|
|
|
|
build\blockchain-explorer\blockchain-explorer.exe ^
|
|
|
|
build\crypto\fift.exe ^
|
|
|
|
build\crypto\tlbc.exe ^
|
|
|
|
build\crypto\func.exe ^
|
|
|
|
build\tolk\tolk.exe ^
|
|
|
|
build\crypto\create-state.exe ^
|
|
|
|
build\validator-engine-console\validator-engine-console.exe ^
|
|
|
|
build\tonlib\tonlib-cli.exe ^
|
|
|
|
build\tonlib\tonlibjson.dll ^
|
|
|
|
build\http\http-proxy.exe ^
|
|
|
|
build\rldp-http-proxy\rldp-http-proxy.exe ^
|
|
|
|
build\dht-server\dht-server.exe ^
|
|
|
|
build\lite-client\lite-client.exe ^
|
|
|
|
build\validator-engine\validator-engine.exe ^
|
|
|
|
build\utils\generate-random-id.exe ^
|
|
|
|
build\utils\json2tlo.exe ^
|
|
|
|
build\utils\proxy-liteserver.exe ^
|
|
|
|
build\adnl\adnl-proxy.exe ^
|
|
|
|
build\emulator\emulator.dll) do (
|
|
|
|
echo strip -s %%I & copy %%I artifacts\
|
|
|
|
strip -s %%I & copy %%I artifacts\
|
|
|
|
)
|
|
|
|
|
2024-06-24 14:09:25 +00:00
|
|
|
xcopy /e /k /h /i crypto\smartcont artifacts\smartcont
|
|
|
|
xcopy /e /k /h /i crypto\fift\lib artifacts\lib
|