-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.bat
More file actions
55 lines (45 loc) · 1.01 KB
/
build.bat
File metadata and controls
55 lines (45 loc) · 1.01 KB
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
@echo off
setlocal
set META_EXE=build\meta.exe
set META_BUILD_SCRIPT=build-meta.bat
if not exist "build" (
mkdir "build"
)
if "%~1"=="1" (
if not exist "build/release" (
mkdir "build/release"
)
) else (
if not exist "build/debug" (
mkdir "build/debug"
)
)
if not exist "%META_EXE%" (
echo Metaprogram missing, building...
call %META_BUILD_SCRIPT%
)
:: Run metaprogram
%META_EXE%
if %ERRORLEVEL% neq 0 (
echo Meta program failed with exit code %ERRORLEVEL%.
exit /b %ERRORLEVEL%
)
set BASE_FLAGS=src ^
-collection:deps=deps ^
-custom-attribute:shader_shared ^
-show-timings ^
-extra-linker-flags:/NODEFAULTLIB:libcmt ^
-linker:radlink
:: If first arg is "1", do release; otherwise debug
if "%~1"=="1" (
set FLAGS=%BASE_FLAGS% ^
-o:speed ^
-out:build/release/main.exe
) else (
set FLAGS=%BASE_FLAGS% ^
-debug ^
-o:none ^
-out:build/debug/main.exe
)
odin build %FLAGS% || exit /b %ERRORLEVEL%
exit /b 0