-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathbuild_win.bat
58 lines (47 loc) · 1.4 KB
/
build_win.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
@ECHO OFF
REM
REM Copyright (c) Contributors to the Open 3D Engine Project.
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
REM
REM SPDX-License-Identifier: Apache-2.0 OR MIT
REM
if [%1] == [] goto ShowHelp
goto SetParams
:ShowHelp
echo Builds AZSLc for Windows.
echo.
echo build_win.bat configuration
echo.
echo configuration Release or Debug
exit /b 1
:SetParams
set configuration=%1
set platform=win
set architecture=x64
set curr_dir=%~dp0
set build_path=%curr_dir%\build\%platform%_%architecture%
set build_output_path=%build_path%\%configuration%
set output_path=%curr_dir%\bin\%platform%_%architecture%\%configuration%
set cmake_exe=%curr_dir%\..\lib\CMake\bin\cmake.exe
REM Configuration has to be 'Release' or 'Debug'
if ["%configuration%"] == ["Release"] goto Build
if ["%configuration%"] == ["Debug"] goto Build
echo Error: incorrect configuration.
goto ShowHelp
:Build
REM ----------------------------------
REM Prepare Solution in build folder
call prepare_solution_win.bat nopause %2
if %errorlevel% neq 0 goto :error
REM ----------------------------------
REM Build AZSLc project
if not exist "%build_path%" goto :error
cd "%build_path%"
%cmake_exe% --build . --config %configuration% --target azslc || goto :error
if %errorlevel% equ 0 @echo build_win.bat: build ok
cd "%curr_dir%"
exit /b 0
:error
@echo Build failed :(
cd "%curr_dir%"
exit /b 1