switch debug/release build order, better futureproof for next cmakeTargets work

This commit is contained in:
Stefano Sinigardi 2019-03-03 23:35:38 +01:00
parent 40cdaaaa43
commit 8fd3e7ad25
2 changed files with 15 additions and 15 deletions

View File

@ -48,19 +48,19 @@ if ($null -eq (Get-Command "cl.exe" -ErrorAction SilentlyContinue)) {
}
if (Test-Path $vcpkg_path) {
# DEBUG
New-Item -Path .\build_win_debug -ItemType directory -Force
Set-Location build_win_debug
cmake -G "Visual Studio 15 2017" -T "host=x64" -A "x64" "-DCMAKE_TOOLCHAIN_FILE=$vcpkg_path\scripts\buildsystems\vcpkg.cmake" "-DVCPKG_TARGET_TRIPLET=$vcpkg_triplet" "-DCMAKE_BUILD_TYPE=Debug" $shared_lib ..
cmake --build . --config Debug --parallel ${number_of_build_workers} --target install
Set-Location ..
# RELEASE
New-Item -Path .\build_win_release -ItemType directory -Force
Set-Location build_win_release
cmake -G "Visual Studio 15 2017" -T "host=x64" -A "x64" "-DCMAKE_TOOLCHAIN_FILE=$vcpkg_path\scripts\buildsystems\vcpkg.cmake" "-DVCPKG_TARGET_TRIPLET=$vcpkg_triplet" "-DCMAKE_BUILD_TYPE=Release" $shared_lib ..
cmake --build . --config Release --parallel ${number_of_build_workers} --target install
Set-Location ..
# DEBUG
New-Item -Path .\build_win_debug -ItemType directory -Force
Set-Location build_win_debug
cmake -G "Visual Studio 15 2017" -T "host=x64" -A "x64" "-DCMAKE_TOOLCHAIN_FILE=$vcpkg_path\scripts\buildsystems\vcpkg.cmake" "-DVCPKG_TARGET_TRIPLET=$vcpkg_triplet" "-DCMAKE_BUILD_TYPE=Debug" $shared_lib ..
cmake --build . --config Debug --parallel ${number_of_build_workers} --target install
Set-Location ..
}
else {
# USE LOCAL PTHREAD LIB, NO VCPKG, ONLY RELEASE

View File

@ -2,14 +2,6 @@
number_of_build_workers=8
# DEBUG
mkdir -p build_debug
cd build_debug
cmake .. -DCMAKE_BUILD_TYPE=Debug
cmake --build . --target install -- -j${number_of_build_workers}
#cmake --build . --target install --parallel ${number_of_build_workers} #valid only for CMake 3.12+
cd ..
# RELEASE
mkdir -p build_release
cd build_release
@ -17,3 +9,11 @@ cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . --target install -- -j${number_of_build_workers}
#cmake --build . --target install --parallel ${number_of_build_workers} #valid only for CMake 3.12+
cd ..
# DEBUG
mkdir -p build_debug
cd build_debug
cmake .. -DCMAKE_BUILD_TYPE=Debug
cmake --build . --target install -- -j${number_of_build_workers}
#cmake --build . --target install --parallel ${number_of_build_workers} #valid only for CMake 3.12+
cd ..