2016-07-07 21:47:33 +01:00
|
|
|
@echo off
|
|
|
|
|
|
|
|
|
|
:: Make sure this is a decent name and not generic
|
|
|
|
|
set exe_name=odin.exe
|
|
|
|
|
|
|
|
|
|
:: Debug = 0, Release = 1
|
2019-09-02 21:16:17 +01:00
|
|
|
set release_mode=0
|
2018-09-09 15:06:04 +01:00
|
|
|
set compiler_flags= -nologo -Oi -TP -fp:precise -Gm- -MP -FC -GS- -EHsc- -GR-
|
2016-07-07 21:47:33 +01:00
|
|
|
|
|
|
|
|
if %release_mode% EQU 0 ( rem Debug
|
2019-09-02 21:16:17 +01:00
|
|
|
set compiler_flags=%compiler_flags% -Od -MDd -Z7
|
2016-09-08 00:23:14 +01:00
|
|
|
rem -DDISPLAY_TIMING
|
2016-07-07 21:47:33 +01:00
|
|
|
) else ( rem Release
|
2019-09-02 21:16:17 +01:00
|
|
|
set compiler_flags=%compiler_flags% -O2 -MT -Z7 -DNO_ARRAY_BOUNDS_CHECK
|
2016-07-07 21:47:33 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
set compiler_warnings= ^
|
2016-12-16 11:31:08 +00:00
|
|
|
-W4 -WX ^
|
2016-11-23 12:25:37 +00:00
|
|
|
-wd4100 -wd4101 -wd4127 -wd4189 ^
|
2018-06-03 17:55:13 +01:00
|
|
|
-wd4201 -wd4204 ^
|
2018-07-01 16:21:32 +01:00
|
|
|
-wd4456 -wd4457 -wd4480 ^
|
2018-02-25 12:29:48 +00:00
|
|
|
-wd4512
|
2016-07-07 21:47:33 +01:00
|
|
|
|
2016-07-21 00:26:14 +01:00
|
|
|
set compiler_includes=
|
2016-10-31 00:10:31 +00:00
|
|
|
set libs= ^
|
2016-11-23 13:46:59 +00:00
|
|
|
kernel32.lib
|
2016-07-07 21:47:33 +01:00
|
|
|
|
|
|
|
|
set linker_flags= -incremental:no -opt:ref -subsystem:console
|
|
|
|
|
|
2016-08-25 00:23:04 +01:00
|
|
|
if %release_mode% EQU 0 ( rem Debug
|
|
|
|
|
set linker_flags=%linker_flags% -debug
|
|
|
|
|
) else ( rem Release
|
2016-10-06 17:11:17 +01:00
|
|
|
set linker_flags=%linker_flags% -debug
|
2016-08-25 00:23:04 +01:00
|
|
|
)
|
2016-07-07 21:47:33 +01:00
|
|
|
|
2016-07-12 23:53:34 +01:00
|
|
|
set compiler_settings=%compiler_includes% %compiler_flags% %compiler_warnings%
|
2016-07-07 21:47:33 +01:00
|
|
|
set linker_settings=%libs% %linker_flags%
|
|
|
|
|
|
2016-12-16 11:31:08 +00:00
|
|
|
del *.pdb > NUL 2> NUL
|
|
|
|
|
del *.ilk > NUL 2> NUL
|
2016-07-07 21:47:33 +01:00
|
|
|
|
2019-09-02 18:35:00 +01:00
|
|
|
cl %compiler_settings% "src\main.cpp" ^
|
|
|
|
|
/link %linker_settings% -OUT:%exe_name% ^
|
2019-12-01 18:18:03 +00:00
|
|
|
&& odin run examples/demo/demo.odin
|
2017-03-05 21:22:33 +00:00
|
|
|
|
|
|
|
|
del *.obj > NUL 2> NUL
|
2017-01-04 11:24:32 +00:00
|
|
|
|
2019-02-23 23:30:03 +00:00
|
|
|
:end_of_build
|