Skip to content

Commit

Permalink
Added release.bat
Browse files Browse the repository at this point in the history
  • Loading branch information
roxlu committed Mar 17, 2022
1 parent b71c9d2 commit 6a574b9
Showing 1 changed file with 79 additions and 0 deletions.
79 changes: 79 additions & 0 deletions build/release.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
@echo off

:: ----------------------------------------------------

set curr_dir=%cd%
set base_dir=%curr_dir%/..
set install_dir=%base_dir%/install
set build_dir=build.release
set extern_dir=%base_dir%/extern

:: ----------------------------------------------------

set cmake_generator=Visual Studio 17 2022
set cmake_build_type=Release
set cmake_config=Release
set debug_flag=
set verbose_flag=

:: ----------------------------------------------------

:: Iterate over command line arguments
:argsloop

if "%1" == "" (
goto :argsloopdone
)

if "%1" == "verbose" (
set verbose_flag=/verbosity:diagnostic /fl
)

if "%1" == "debug" (
set debug_flag=-debug
set cmake_build_type=Debug
set cmake_config=Debug
set build_dir=build.debug
)

shift
goto :argsloop
:argsloopdone

:: ----------------------------------------------------

if not exist "%curr_dir%/%build_dir%" mkdir "%curr_dir%/%build_dir%"
if not exist "%install_dir%" mkdir "%install_dir%"

:: ----------------------------------------------------

cd "%curr_dir%/%build_dir%"

@echo on
cmake -G "%cmake_generator%" ^
-A X64 ^
-DCMAKE_INSTALL_PREFIX="%install_dir%" ^
-DCMAKE_VERBOSE_MAKEFILE=On ^
-DCMAKE_BUILD_TYPE="%cmake_build_type%" ^
..

echo Done
if errorlevel 1 goto err

:: ----------------------------------------------------

cmake --build . ^
--target install ^
--config "%cmake_config%" ^
--parallel 12 ^
-- %verbose_flag%

if errorlevel 1 goto err

:: ----------------------------------------------------

cd "%install_dir%"
cd bin
test-b

:: ----------------------------------------------------

0 comments on commit 6a574b9

Please sign in to comment.