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
|
|
|
|
|
2023-06-17 18:10:11 +00:00
|
|
|
set pthread_dir=..\vcpkg\packages\pthreads_x64-windows
|
|
|
|
|
2023-06-16 17:46:58 +00:00
|
|
|
::copy libraries
|
|
|
|
copy milepost\bin\milepost.dll bin
|
|
|
|
copy milepost\bin\milepost.dll.lib bin
|
2023-06-17 18:10:11 +00:00
|
|
|
copy %pthread_dir%\bin\pthreadVC3.dll bin
|
2023-06-16 17:46:58 +00:00
|
|
|
|
|
|
|
::generate wasm3 api bindings
|
|
|
|
python3 scripts\bindgen.py core src
|
|
|
|
|
|
|
|
python3 scripts\bindgen.py gles src
|
|
|
|
|
|
|
|
python3 scripts\bindgen2.py canvas src\canvas_api.json^
|
|
|
|
--guest-stubs sdk\orca_surface.c^
|
|
|
|
--guest-include graphics.h^
|
|
|
|
--wasm3-bindings src\canvas_api_bind_gen.c
|
|
|
|
|
2023-07-14 04:38:32 +00:00
|
|
|
python3 scripts\bindgen2.py clock src\clock_api.json^
|
|
|
|
--guest-stubs sdk\orca_clock.c^
|
|
|
|
--guest-include platform_clock.h^
|
|
|
|
--wasm3-bindings src\clock_api_bind_gen.c
|
|
|
|
|
2023-06-16 17:46:58 +00:00
|
|
|
python3 scripts\bindgen2.py io^
|
|
|
|
src\io_api.json^
|
|
|
|
--guest-stubs sdk\io_stubs.c^
|
|
|
|
--wasm3-bindings src\io_api_bind_gen.c
|
|
|
|
|
|
|
|
::compile orca
|
2023-06-17 18:10:11 +00:00
|
|
|
set INCLUDES=/I src /I sdk /I ext\wasm3\source /I milepost\src /I milepost\ext /I %pthread_dir%\include
|
|
|
|
set LIBS=/LIBPATH:bin /LIBPATH:%pthread_dir%\lib milepost.dll.lib wasm3.lib pthreadVC3.lib
|
2023-06-16 17:46:58 +00:00
|
|
|
|
|
|
|
cl /Zi /Zc:preprocessor /std:c11 %INCLUDES% src\main.c /link %LIBS% /out:bin\orca.exe
|
|
|
|
)
|