wasm, app
This commit is contained in:
32
build_file.c
32
build_file.c
@@ -36,7 +36,7 @@ int main(int argc, char **argv) {
|
||||
b32 run_server = false;
|
||||
b32 core_test_target = true;
|
||||
b32 win32_target = true;
|
||||
b32 wasm_target = false;
|
||||
b32 wasm_target = true;
|
||||
|
||||
if (run_server) {
|
||||
os_systemf("start /D ..\\package ..\\package\\run_server.bat");
|
||||
@@ -70,18 +70,24 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
|
||||
|
||||
if (wasm_target && cache_code_modified(s8_lit("../src/wasm_app/main.c"), s8_lit("main.wasm"))) {
|
||||
os_copy("../src/app/app_wasm.html", "../package/index.html", os_copy_overwrite);
|
||||
ok = os_systemf(
|
||||
"clang.exe ../src/wasm_app/main.c -o main.wasm"
|
||||
" -Oz -g -I../src"
|
||||
" -Wall -Wno-missing-braces"
|
||||
" -fdiagnostics-absolute-paths -fdiagnostics-format=msvc"
|
||||
" --target=wasm32 -nostdlib -mbulk-memory -msimd128"
|
||||
" -Wl,-export-dynamic,--allow-undefined,--import-memory,--no-entry,--initial-memory=131072000,--max-memory=4294967296"
|
||||
);
|
||||
os_copy("main.wasm", "../package/main.wasm", os_copy_overwrite);
|
||||
if (ok != 0) return ok;
|
||||
if (wasm_target) {
|
||||
b32 html_code_modified = cache_code_modified(s8_lit("../src/app/app_wasm.html"), s8_lit("../package/index.html"));
|
||||
b32 wasm_code_modified = cache_code_modified(s8_lit("../src/wasm_app/main.c"), s8_lit("main.wasm"));
|
||||
if (html_code_modified) {
|
||||
os_copy("../src/app/app_wasm.html", "../package/index.html", os_copy_overwrite);
|
||||
}
|
||||
if (wasm_code_modified) {
|
||||
ok = os_systemf(
|
||||
"clang.exe ../src/wasm_app/main.c -o main.wasm"
|
||||
" -Oz -g -I../src"
|
||||
" -Wall -Wno-missing-braces -Wno-single-bit-bitfield-constant-conversion"
|
||||
" -fdiagnostics-absolute-paths -fdiagnostics-format=msvc"
|
||||
" --target=wasm32 -nostdlib -mbulk-memory -msimd128"
|
||||
" -Wl,-export-dynamic,--allow-undefined,--import-memory,--no-entry,--initial-memory=131072000,--max-memory=4294967296"
|
||||
);
|
||||
os_copy("main.wasm", "../package/main.wasm", os_copy_overwrite);
|
||||
if (ok != 0) return ok;
|
||||
}
|
||||
}
|
||||
|
||||
cache_save();
|
||||
|
||||
Reference in New Issue
Block a user