21 lines
835 B
Batchfile
21 lines
835 B
Batchfile
@echo off
|
|
|
|
for %%a in (%*) do set "%%~a=1"
|
|
|
|
|
|
set common=-I ../src/ -g -fdiagnostics-absolute-paths -Wno-unsequenced -Wno-single-bit-bitfield-constant-conversion -Wall -Wno-missing-braces -Wextra -Wno-missing-field-initializers
|
|
set wasm_flags=--target=wasm32 -nostdlib -mbulk-memory -msimd128 -Wl,-export-dynamic,--allow-undefined,--import-memory,--no-entry,--initial-memory=131072000,--max-memory=4294967296
|
|
|
|
if not exist build (
|
|
mkdir build
|
|
)
|
|
pushd build
|
|
if "%testing%"=="1" echo [testing] && set didbuild=1 && clang ../src/testing/testing_main.c -o testing.exe %common% || exit 1 /b
|
|
if "%scratch%"=="1" echo [scratch] && set didbuild=1 && clang ../src/scratch/scratch_main.c -o ../src/scratch/main.wasm %common% %wasm_flags% || exit 1 /b
|
|
popd
|
|
|
|
if "%didbuild%"=="" (
|
|
echo [WARNING] no valid build target specified
|
|
exit /b 1
|
|
)
|