2023-06-16 17:46:58 +00:00
|
|
|
@echo off
|
|
|
|
|
|
|
|
set target=%1%
|
|
|
|
if "%~1%" == "" set target=orca
|
|
|
|
|
|
|
|
if not exist bin mkdir bin
|
|
|
|
if not exist bin\obj mkdir bin\obj
|
|
|
|
|
|
|
|
if %target% == wasm3 (
|
|
|
|
echo building wasm3
|
|
|
|
|
|
|
|
set wasm3_includes=/I .\ext\wasm3\source
|
|
|
|
set wasm3_sources=/I .\ext\wasm3\source\*.c
|
|
|
|
|
|
|
|
for %%f in ( .\ext\wasm3\source\*.c ) do (
|
2023-07-06 13:06:34 +00:00
|
|
|
cl /nologo /Zi /Zc:preprocessor /O2 /c /Fo:bin\obj\%%~nf.obj %wasm3_includes% %%f
|
2023-06-16 17:46:58 +00:00
|
|
|
)
|
|
|
|
lib /nologo /out:bin\wasm3.lib bin\obj\*.obj
|
|
|
|
)
|
|
|
|
|
|
|
|
if %target% == milepost (
|
|
|
|
echo building milepost
|
|
|
|
cd milepost
|
|
|
|
build.bat
|
|
|
|
cd ..
|
|
|
|
)
|
|
|
|
|
|
|
|
if %target% == orca (
|
|
|
|
echo building orca
|
|
|
|
|
|
|
|
::copy libraries
|
|
|
|
copy milepost\bin\milepost.dll bin
|
|
|
|
copy milepost\bin\milepost.dll.lib bin
|
|
|
|
|
|
|
|
::generate wasm3 api bindings
|
2023-07-29 04:46:56 +00:00
|
|
|
python3 scripts\bindgen.py core src\core_api.json^
|
|
|
|
--wasm3-bindings src\core_api_bind_gen.c
|
2023-06-16 17:46:58 +00:00
|
|
|
|
2023-07-29 04:46:56 +00:00
|
|
|
python3 scripts\bindgen.py gles src\gles_api.json^
|
|
|
|
--wasm3-bindings src\gles_api_bind_gen.c
|
2023-06-16 17:46:58 +00:00
|
|
|
|
2023-07-29 04:46:56 +00:00
|
|
|
python3 scripts\bindgen.py canvas src\canvas_api.json^
|
2023-06-16 17:46:58 +00:00
|
|
|
--guest-stubs sdk\orca_surface.c^
|
|
|
|
--guest-include graphics.h^
|
|
|
|
--wasm3-bindings src\canvas_api_bind_gen.c
|
|
|
|
|
2023-07-29 04:46:56 +00:00
|
|
|
python3 scripts\bindgen.py clock src\clock_api.json^
|
2023-07-14 04:38:32 +00:00
|
|
|
--guest-stubs sdk\orca_clock.c^
|
|
|
|
--guest-include platform_clock.h^
|
|
|
|
--wasm3-bindings src\clock_api_bind_gen.c
|
|
|
|
|
2023-07-29 04:46:56 +00:00
|
|
|
python3 scripts\bindgen.py io^
|
2023-06-16 17:46:58 +00:00
|
|
|
src\io_api.json^
|
|
|
|
--guest-stubs sdk\io_stubs.c^
|
|
|
|
--wasm3-bindings src\io_api_bind_gen.c
|
|
|
|
|
|
|
|
::compile orca
|
2023-07-31 04:35:08 +00:00
|
|
|
set INCLUDES=/I src /I sdk /I ext\wasm3\source /I milepost\src /I milepost\ext
|
|
|
|
set LIBS=/LIBPATH:bin milepost.dll.lib wasm3.lib
|
2023-06-16 17:46:58 +00:00
|
|
|
|
2023-07-31 04:35:08 +00:00
|
|
|
cl /Zi /Zc:preprocessor /std:c11 /experimental:c11atomics %INCLUDES% src\main.c /link %LIBS% /out:bin\orca.exe
|
2023-06-16 17:46:58 +00:00
|
|
|
)
|