-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.cmd
53 lines (42 loc) · 1.32 KB
/
build.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
:: Copyright dSPACE GmbH. All rights reserved.
@echo off
setlocal enabledelayedexpansion
set currentDir=%~dp0.
set config=%1
set platformToUse=%2
if "%config%"=="" (
set config=Debug
)
if "%platformToUse%"=="" (
if "%platform%"=="" (
set platformToUse=x64
call :DevEnv || exit /b 1
) else (
set platformToUse=%platform%
)
) else (
if "%platform%" == "" (
call :DevEnv || exit /b 1
) else (
if "%platform%" neq "%platformToUse%" (
echo Environment is already set up for %platform%
exit /b 1
)
)
)
echo Building %config% %platformToUse% ...
set buildDir=%currentDir%\tmpwin\%config%\%platformToUse%
if not exist "%buildDir%" mkdir "%buildDir%" || exit /b 1
cd "%buildDir%"
cmake ..\..\.. -GNinja -DCMAKE_BUILD_TYPE=%config% -DDSVEOSCOSIM_BUILD_TESTS=ON || exit /b 1
cmake --build . --config %config% || exit /b 1
echo Building %config% %platformToUse% finished successfully.
exit /b 0
:DevEnv
set fileName=vcvars32.bat
if "%platformToUse%"=="x64" (
set fileName=vcvars64.bat
)
call "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\%fileName%" || exit /b 1
set DevEnvDir=C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\
exit /b 0