using cache in build_file, ui metaprogram and generating stacks
This commit is contained in:
20
build_file.c
20
build_file.c
@@ -11,23 +11,29 @@
|
||||
#include "src/meta/cgen.c"
|
||||
|
||||
#include "src/app/app.meta.c"
|
||||
#include "src/ui/ui.meta.c"
|
||||
#include "src/wasm_app/wasm_app.meta.c"
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
SRC_SearchPaths.include_path = (char*[]){OS_GetAbsolutePath(&Perm, s8_lit("../src")).str};
|
||||
SRC_SearchPaths.include_path_count = 1;
|
||||
cache_init(&Perm, s8_lit("cache_build_file"));
|
||||
ma_arena_t *arena = ma_create(ma_default_reserve_size);
|
||||
int ok = 0;
|
||||
|
||||
ma_arena_t *arena = ma_create(ma_default_reserve_size);
|
||||
if (cache_code_modified(s8_lit("../src/core/core_math_gen.py"), s8_null)) {
|
||||
b32 generate_math = true;
|
||||
|
||||
if (generate_math && cache_code_modified(s8_lit("../src/core/core_math_gen.py"), s8_null)) {
|
||||
os_set_working_dir("../src/core");
|
||||
os_systemf("py core_math_gen.py");
|
||||
os_set_working_dir("../../build");
|
||||
}
|
||||
mt_ui(arena);
|
||||
mt_app(arena);
|
||||
mt_wasm_app(arena);
|
||||
|
||||
b32 run_server = false;
|
||||
b32 core_test_target = false;
|
||||
b32 core_test_target = true;
|
||||
b32 win32_target = true;
|
||||
b32 wasm_target = false;
|
||||
|
||||
@@ -35,7 +41,7 @@ int main(int argc, char **argv) {
|
||||
os_systemf("start /D ..\\package ..\\package\\run_server.bat");
|
||||
}
|
||||
|
||||
if (win32_target) {
|
||||
if (win32_target && cache_code_modified(s8_lit("../src/wasm_app/main.c"), s8_lit("app_win32.exe"))) {
|
||||
os_delete_file(s8_lit("app_win32.pdb"));
|
||||
ok = os_systemf(
|
||||
"cl ../src/wasm_app/main.c -Fe:app_win32.exe -Fd:app_win32.pdb"
|
||||
@@ -47,7 +53,7 @@ int main(int argc, char **argv) {
|
||||
if (ok != 0) return ok;
|
||||
}
|
||||
|
||||
if (core_test_target) {
|
||||
if (core_test_target && cache_code_modified(s8_lit("../src/core/core_test_entry.c"), s8_lit("core_test.exe"))) {
|
||||
os_delete_file(s8_lit("core_test.pdb"));
|
||||
ok = os_systemf(
|
||||
"cl ../src/core/core_test_entry.c -Fe:core_test.exe -Fd:core_test.pdb"
|
||||
@@ -59,11 +65,11 @@ int main(int argc, char **argv) {
|
||||
if (ok != 0) return ok;
|
||||
|
||||
ok = os_systemf("core_test.exe");
|
||||
return ok;
|
||||
if (ok != 0) return ok;
|
||||
}
|
||||
|
||||
|
||||
if (wasm_target) {
|
||||
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"
|
||||
|
||||
Reference in New Issue
Block a user