update Windows + Linux deps build scripts to adapt the new folder structure
This commit is contained in:
parent
c774a67bc6
commit
46102427c0
@ -23,8 +23,16 @@ script_dir=$( cd -- "$( dirname -- "${0}" )" &> /dev/null && pwd )
|
|||||||
deps_dir="$script_dir/build/linux/deps"
|
deps_dir="$script_dir/build/linux/deps"
|
||||||
third_party_dir="$script_dir/third-party"
|
third_party_dir="$script_dir/third-party"
|
||||||
third_party_deps_dir="$third_party_dir/deps/linux"
|
third_party_deps_dir="$third_party_dir/deps/linux"
|
||||||
third_party_common_dir="$third_party_dir/deps/common/src"
|
third_party_common_dir="$third_party_dir/deps/common"
|
||||||
mycmake="$third_party_deps_dir/cmake-3.27.7-linux-x86_64/bin/cmake"
|
mycmake="$third_party_deps_dir/cmake/bin/cmake"
|
||||||
|
|
||||||
|
deps_archives=(
|
||||||
|
"libssq/libssq.tar.gz"
|
||||||
|
"zlib/zlib.tar.gz"
|
||||||
|
"curl/curl.tar.gz"
|
||||||
|
"protobuf/protobuf.tar.gz"
|
||||||
|
"mbedtls/mbedtls.tar.gz"
|
||||||
|
)
|
||||||
|
|
||||||
# < 0: deduce, > 1: force
|
# < 0: deduce, > 1: force
|
||||||
PARALLEL_THREADS_OVERRIDE=-1
|
PARALLEL_THREADS_OVERRIDE=-1
|
||||||
@ -154,30 +162,23 @@ clean_gen64="[[ -d build64 ]] && rm -f -r build64/"
|
|||||||
|
|
||||||
chmod 777 "$mycmake"
|
chmod 777 "$mycmake"
|
||||||
|
|
||||||
declare -A deps_archives=(
|
|
||||||
["v3.0.0.tar.gz"]="ssq"
|
|
||||||
["zlib-1.3.tar.gz"]="zlib"
|
|
||||||
["curl-8.4.0.tar.gz"]="curl"
|
|
||||||
["v21.12.tar.gz"]="protobuf"
|
|
||||||
["mbedtls-3.5.1.tar.gz"]="mbedtls"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
# the artificial delays "sleep 3" are here because on Windows WSL the
|
# the artificial delays "sleep 3" are here because on Windows WSL the
|
||||||
# explorer or search indexer keeps a handle open and causes an error here
|
# explorer or search indexer keeps a handle open and causes an error here
|
||||||
echo // extracting archives
|
echo // extracting archives
|
||||||
dotglob_state="$( shopt -p dotglob )"
|
dotglob_state="$( shopt -p dotglob )"
|
||||||
for f in "${!deps_archives[@]}"; do
|
for f in "${deps_archives[@]}"; do
|
||||||
[[ -f "$third_party_common_dir/$f" ]] || {
|
src_arch="$third_party_common_dir/$f"
|
||||||
echo "[X] archive '$f' not found";
|
[[ -f "$src_arch" ]] || {
|
||||||
|
echo "[X] archive '"$src_arch"' not found";
|
||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
target_dir="$deps_dir/${deps_archives["$f"]}"
|
target_dir="$deps_dir/$( dirname "$f" )"
|
||||||
mkdir -p "$target_dir"
|
mkdir -p "$target_dir"
|
||||||
|
|
||||||
echo - extracting archive "'$f'" into "'$target_dir'"
|
echo - extracting archive "'$f'" into "'$target_dir'"
|
||||||
tar -zxf "$third_party_common_dir/$f" -C "$target_dir"
|
tar -zxf "$src_arch" -C "$target_dir"
|
||||||
sleep 2
|
sleep 2
|
||||||
|
|
||||||
echo - flattening dir "'$target_dir'" by moving everything in a subdir outside
|
echo - flattening dir "'$target_dir'" by moving everything in a subdir outside
|
||||||
@ -197,7 +198,7 @@ done
|
|||||||
|
|
||||||
############## build ssq ##############
|
############## build ssq ##############
|
||||||
echo // building ssq lib
|
echo // building ssq lib
|
||||||
pushd "$deps_dir/ssq"
|
pushd "$deps_dir/libssq"
|
||||||
|
|
||||||
eval $recreate_32
|
eval $recreate_32
|
||||||
eval $cmake_gen32
|
eval $cmake_gen32
|
||||||
|
@ -6,9 +6,9 @@ pushd "%~dp0"
|
|||||||
set "deps_dir=build\win\deps"
|
set "deps_dir=build\win\deps"
|
||||||
set "third_party_dir=third-party"
|
set "third_party_dir=third-party"
|
||||||
set "third_party_deps_dir=%third_party_dir%\deps\win"
|
set "third_party_deps_dir=%third_party_dir%\deps\win"
|
||||||
set "third_party_common_dir=%third_party_dir%\deps\common\src"
|
set "third_party_common_dir=%third_party_dir%\deps\common"
|
||||||
set "extractor=%third_party_deps_dir%\7za-win\7za.exe"
|
set "extractor=%third_party_deps_dir%\7za\7za.exe"
|
||||||
set "mycmake=%~dp0%third_party_deps_dir%\cmake-3.27.7-windows-x86_64\bin\cmake.exe"
|
set "mycmake=%~dp0%third_party_deps_dir%\cmake\bin\cmake.exe"
|
||||||
|
|
||||||
set /a last_code=0
|
set /a last_code=0
|
||||||
|
|
||||||
@ -72,6 +72,7 @@ call :extract_all_deps || (
|
|||||||
goto :end_script
|
goto :end_script
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
:: ############## common CMAKE args ##############
|
:: ############## common CMAKE args ##############
|
||||||
:: https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_FLAGS_CONFIG.html#variable:CMAKE_%3CLANG%3E_FLAGS_%3CCONFIG%3E
|
:: https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_FLAGS_CONFIG.html#variable:CMAKE_%3CLANG%3E_FLAGS_%3CCONFIG%3E
|
||||||
set cmake_common_args=-G "Visual Studio 17 2022" -S .
|
set cmake_common_args=-G "Visual Studio 17 2022" -S .
|
||||||
@ -106,7 +107,7 @@ echo // [?] All CMAKE builds will use %jobs_count% parallel jobs
|
|||||||
|
|
||||||
:: ############## build ssq ##############
|
:: ############## build ssq ##############
|
||||||
echo // building ssq lib
|
echo // building ssq lib
|
||||||
pushd "%deps_dir%\ssq"
|
pushd "%deps_dir%\libssq"
|
||||||
|
|
||||||
setlocal
|
setlocal
|
||||||
call "%~dp0build_win_set_env.bat" 32 || (
|
call "%~dp0build_win_set_env.bat" 32 || (
|
||||||
@ -349,43 +350,44 @@ goto :end_script
|
|||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
|
||||||
|
echo // Recreating dir...
|
||||||
rmdir /s /q "%deps_dir%"
|
rmdir /s /q "%deps_dir%"
|
||||||
mkdir "%deps_dir%"
|
mkdir "%deps_dir%"
|
||||||
for /f "usebackq eol=; skip=%list% tokens=1,2 delims=|" %%A in ("%~f0") do (
|
for /f "usebackq eol=; skip=%list% tokens=1,* delims=\" %%A in ("%~f0") do (
|
||||||
if "%%~A"=="]" (
|
if "%%~A"=="]" (
|
||||||
goto :extract_all_deps_end
|
goto :extract_all_deps_end
|
||||||
)
|
)
|
||||||
|
|
||||||
echo // Extracting archive "%third_party_common_dir%\%%~A" to "%deps_dir%\%%~B"
|
echo // Extracting archive "%%~B" to "%deps_dir%\%%~A"
|
||||||
if not exist "%third_party_common_dir%\%%~A" (
|
if not exist "%third_party_common_dir%\%%~A\%%~B" (
|
||||||
call :err_msg "File not found"
|
call :err_msg "File not found"
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
for /f "usebackq tokens=* delims=" %%Z in ('"%%~nA"') do (
|
for /f "usebackq tokens=* delims=" %%Z in ('"%%~nB"') do (
|
||||||
if /i "%%~xZ%%~xA"==".tar.gz" (
|
if /i "%%~xZ%%~xB"==".tar.gz" (
|
||||||
"%extractor%" x "%third_party_common_dir%\%%~A" -so | "%extractor%" x -si -ttar -y -aoa -o"%deps_dir%\%%~B" || (
|
"%extractor%" x "%third_party_common_dir%\%%~A\%%~B" -so | "%extractor%" x -si -ttar -y -aoa -o"%deps_dir%\%%~A" || (
|
||||||
call :err_msg "Extraction failed"
|
call :err_msg "Extraction failed"
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
) else (
|
) else (
|
||||||
"%extractor%" x "%third_party_common_dir%\%%~A" -y -aoa -o"%deps_dir%\%%~B" || (
|
"%extractor%" x "%third_party_common_dir%\%%~A\%%~B" -y -aoa -o"%deps_dir%\%%~A" || (
|
||||||
call :err_msg "Extraction failed"
|
call :err_msg "Extraction failed"
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
for /f "tokens=* delims=" %%C in ('dir /b /a:d "%deps_dir%\%%~B\" 2^>nul') do (
|
for /f "tokens=* delims=" %%C in ('dir /b /a:d "%deps_dir%\%%~A\" 2^>nul') do (
|
||||||
echo // Flattening dir "%deps_dir%\%%~B\%%~C" by moving everything inside it to "%deps_dir%\%%~B"
|
echo // Flattening dir "%deps_dir%\%%~A\%%~C" by moving everything inside it to "%deps_dir%\%%~A"
|
||||||
robocopy /E /MOVE /MT4 /NS /NC /NFL /NDL /NP /NJH /NJS "%deps_dir%\%%~B\%%~C" "%deps_dir%\%%~B"
|
robocopy /E /MOVE /MT4 /NS /NC /NFL /NDL /NP /NJH /NJS "%deps_dir%\%%~A\%%~C" "%deps_dir%\%%~A"
|
||||||
if ERRORLEVEL 8 (
|
if ERRORLEVEL 8 (
|
||||||
call :err_msg "Failed to flatten dir of dep"
|
call :err_msg "Failed to flatten dir of dep"
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
|
||||||
if exist "%deps_dir%\%%~B\%%~C" (
|
if exist "%deps_dir%\%%~A\%%~C" (
|
||||||
echo // Removing nested dir "%deps_dir%\%%~B\%%~C"
|
echo // Removing nested dir "%deps_dir%\%%~A\%%~C"
|
||||||
rmdir /s /q "%deps_dir%\%%~B\%%~C"
|
rmdir /s /q "%deps_dir%\%%~A\%%~C"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -413,9 +415,9 @@ endlocal & (
|
|||||||
|
|
||||||
|
|
||||||
deps_to_extract=[
|
deps_to_extract=[
|
||||||
v3.0.0.tar.gz|ssq
|
libssq\libssq.tar.gz
|
||||||
zlib-1.3.tar.gz|zlib
|
zlib\zlib.tar.gz
|
||||||
curl-8.4.0.tar.gz|curl
|
curl\curl.tar.gz
|
||||||
v21.12.tar.gz|protobuf
|
protobuf\protobuf.tar.gz
|
||||||
mbedtls-3.5.1.tar.gz|mbedtls
|
mbedtls\mbedtls.tar.gz
|
||||||
]
|
]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user