forked from OpenModelica/OMSimulator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildWinVS.bat
63 lines (51 loc) · 2.49 KB
/
buildWinVS.bat
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
54
55
56
57
58
59
60
61
62
63
@ECHO off
REM run this on wsl using:
REM cmd.exe /C "SET CMAKE_BUILD_TYPE=Debug && buildWinVS.bat VS15-Win64"
SET OMS_VS_TARGET=%~1
IF ["%OMS_VS_TARGET%"]==["VS14-Win32"] SET OMS_VS_PLATFORM=32 && SET OMS_VS_VERSION="Visual Studio 14 2015"
IF ["%OMS_VS_TARGET%"]==["VS14-Win64"] SET OMS_VS_PLATFORM=64 && SET OMS_VS_VERSION="Visual Studio 14 2015 Win64"
IF ["%OMS_VS_TARGET%"]==["VS15-Win32"] SET OMS_VS_PLATFORM=32 && SET OMS_VS_VERSION="Visual Studio 15 2017"
IF ["%OMS_VS_TARGET%"]==["VS15-Win64"] SET OMS_VS_PLATFORM=64 && SET OMS_VS_VERSION="Visual Studio 15 2017 Win64"
IF NOT DEFINED OMS_VS_VERSION (
ECHO No argument or unsupported argument given. Use one of the following VS version strings:
ECHO "VS14-Win32" for Visual Studio 14 2015
ECHO "VS14-Win64" for Visual Studio 14 2015 Win64
ECHO "VS15-Win32" for Visual Studio 15 2017
ECHO "VS15-Win64" for Visual Studio 15 2017 Win64
GOTO fail
)
SET OMS_VS_TARGET
SET OMS_VS_VERSION
SET OMS_VS_PLATFORM
ECHO.
SET VSCMD_START_DIR="%CD%"
IF ["%OMS_VS_TARGET%"]==["VS14-Win32"] @CALL "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" x86
IF ["%OMS_VS_TARGET%"]==["VS14-Win64"] @CALL "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64
IF ["%OMS_VS_TARGET%"]==["VS15-Win32"] @CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x86
IF ["%OMS_VS_TARGET%"]==["VS15-Win64"] @CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64
IF NOT DEFINED CMAKE_BUILD_TYPE SET CMAKE_BUILD_TYPE="Release"
MKDIR install\win\bin
:: -- build OMTLMSimulator ----------------------------------------------------
ECHO # Building OMTLMSimulator
CD OMTLMSimulator
START /B /WAIT CMD /C "buildWinVS.bat %OMS_VS_TARGET%"
IF NOT ["%ERRORLEVEL%"]==["0"] GOTO fail
CD..
COPY /Y OMTLMSimulator\bin\omtlmsimulator.lib install\win\bin
COPY /Y OMTLMSimulator\bin\omtlmsimulator.dll install\win\bin
ECHO %CD%
:: -- build OMTLMSimulator ----------------------------------------------------
:: -- build OMSimulator -------------------------------------------------------
ECHO # build OMSimulator
msbuild.exe "build\win\INSTALL.vcxproj" /t:Build /p:configuration=%CMAKE_BUILD_TYPE% /maxcpucount
IF NOT ["%ERRORLEVEL%"]==["0"] GOTO fail
:: -- build OMSimulator -------------------------------------------------------
install\win\bin\OMSimulator.exe --version
IF NOT ["%ERRORLEVEL%"]==["0"] GOTO omsfail
EXIT /B 0
:fail
ECHO Build failed!
EXIT /B 1
:omsfail
ECHO OMSimulator.exe does not start!
EXIT /B 1