1@if "%ECHOON%" == "" (@echo off) else (@echo %ECHOON%)&:: set ECHOON=on if you want to debug this script
2@::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
3@::  THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY  ::
4@::  Read the zproject/README.md for information about making permanent changes. ::
5@::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
6:: Usage:     build.bat [Clean]
7@setlocal
8
9:: make sure our directory is correct for building
10@pushd %~dp0%
11
12:: supports passing in Clean as third argument if "make clean" behavior is desired
13SET action=Building
14SET target=%1
15if NOT "%target%" == "" set target=/t:%target%&set action=Cleaning
16
17SET solution=zyre.sln
18SET version=14
19SET log=build.log
20SET tools=Microsoft Visual Studio %version%.0\VC\vcvarsall.bat
21if "%version%" == "15" SET tools=Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat
22SET environment="%programfiles(x86)%\%tools%"
23IF NOT EXIST %environment% SET environment="%programfiles%\%tools%"
24IF NOT EXIST %environment% GOTO no_tools
25
26SET packages=
27IF EXIST "..\..\..\..\libzmq\builds/msvc/vs2015\libzmq.import.props" (
28    COPY /Y "..\..\..\..\libzmq\builds/msvc/vs2015\libzmq.import.props" . > %log%
29    IF errorlevel 1 GOTO error
30) ELSE (
31    ECHO Did not find libzmq, aborting.
32    ECHO Please clone from https://github.com/zeromq/libzmq.git, and then build.
33    GOTO error
34)
35IF EXIST "..\..\..\..\czmq\builds/msvc/vs2015\czmq.import.props" (
36    COPY /Y "..\..\..\..\czmq\builds/msvc/vs2015\czmq.import.props" . > %log%
37    IF errorlevel 1 GOTO error
38) ELSE (
39    ECHO Did not find czmq, aborting.
40    ECHO Please clone from https://github.com/zeromq/czmq.git, and then build.
41    GOTO error
42)
43
44ECHO %action% zyre... (%packages%)
45
46:: save original path
47@set oldpath=%PATH%
48
49:: set correct environment for build target
50CALL %environment% x86 >> %log%
51@if "%ECHOON%" == "" (@echo off) else (@echo %ECHOON%)&:: set ECHOON=on if you want to debug this script
52ECHO Platform=x86
53
54ECHO Configuration=DynDebug
55msbuild /m /v:n /p:Configuration=DynDebug /p:Platform=Win32 %packages% %solution% %target% >> %log%
56IF errorlevel 1 GOTO error
57ECHO Configuration=DynRelease
58msbuild /m /v:n /p:Configuration=DynRelease /p:Platform=Win32 %packages% %solution% %target% >> %log%
59IF errorlevel 1 GOTO error
60ECHO Configuration=LtcgDebug
61msbuild /m /v:n /p:Configuration=LtcgDebug /p:Platform=Win32 %packages% %solution% %target% >> %log%
62IF errorlevel 1 GOTO error
63ECHO Configuration=LtcgRelease
64msbuild /m /v:n /p:Configuration=LtcgRelease /p:Platform=Win32 %packages% %solution% %target% >> %log%
65IF errorlevel 1 GOTO error
66ECHO Configuration=StaticDebug
67msbuild /m /v:n /p:Configuration=StaticDebug /p:Platform=Win32 %packages% %solution% %target% >> %log%
68IF errorlevel 1 GOTO error
69ECHO Configuration=StaticRelease
70msbuild /m /v:n /p:Configuration=StaticRelease /p:Platform=Win32 %packages% %solution% %target% >> %log%
71IF errorlevel 1 GOTO error
72
73:: restore original path
74@set PATH=%oldpath%
75
76:: set correct environment for build target
77CALL %environment% x86_amd64 >> %log%
78@if "%ECHOON%" == "" (@echo off) else (@echo %ECHOON%)&:: set ECHOON=on if you want to debug this script
79ECHO Platform=x64
80
81ECHO Configuration=DynDebug
82msbuild /m /v:n /p:Configuration=DynDebug /p:Platform=x64 %packages% %solution% %target% >> %log%
83IF errorlevel 1 GOTO error
84ECHO Configuration=DynRelease
85msbuild /m /v:n /p:Configuration=DynRelease /p:Platform=x64 %packages% %solution% %target% >> %log%
86IF errorlevel 1 GOTO error
87ECHO Configuration=LtcgDebug
88msbuild /m /v:n /p:Configuration=LtcgDebug /p:Platform=x64 %packages% %solution% %target% >> %log%
89IF errorlevel 1 GOTO error
90ECHO Configuration=LtcgRelease
91msbuild /m /v:n /p:Configuration=LtcgRelease /p:Platform=x64 %packages% %solution% %target% >> %log%
92IF errorlevel 1 GOTO error
93ECHO Configuration=StaticDebug
94msbuild /m /v:n /p:Configuration=StaticDebug /p:Platform=x64 %packages% %solution% %target% >> %log%
95IF errorlevel 1 GOTO error
96ECHO Configuration=StaticRelease
97msbuild /m /v:n /p:Configuration=StaticRelease /p:Platform=x64 %packages% %solution% %target% >> %log%
98IF errorlevel 1 GOTO error
99
100ECHO %action% complete: %packages% %solution%
101GOTO end
102
103:error
104ECHO *** ERROR, build terminated early: see %log%
105GOTO end
106
107:no_tools
108ECHO *** ERROR, build tools not found: %tools%
109
110:end
111:: restore original path
112if NOT "%oldpath%" == "" @set PATH=%oldpath%
113popd
114@endlocal
115