don't include generated math into build_file, use cache, ui

This commit is contained in:
Krzosa Karol
2025-01-17 13:35:35 +01:00
parent 0ad84c9fc7
commit d3c84fd666
18 changed files with 255 additions and 164 deletions

View File

@@ -1,4 +1,5 @@
// don't ever include stuff that build_file will generate code for!
#define DONT_INCLUDE_GENERATED_MATH
#include "src/core/core_inc.h"
#include "src/core/core_inc.c"
@@ -22,13 +23,13 @@ void list_files_recursive(sb8_t *sb, s8_t path) {
}
int main(int argc, char **argv) {
cache_init(&Perm, s8_lit("cache_build_file"));
int ok = 0;
ma_arena_t *arena = ma_create(ma_default_reserve_size);
meta_app(arena);
meta_ui(arena);
b32 generate_math_library = false; // WARNING: be wary of this, cause it might break build file
b32 execute_python_snippets = false; // make sure to not abuse just for quick maths
b32 run_server = false;
@@ -36,7 +37,7 @@ int main(int argc, char **argv) {
b32 win32_target = true;
b32 wasm_target = false;
if (generate_math_library) {
if (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");
@@ -110,5 +111,7 @@ int main(int argc, char **argv) {
os_copy("main.wasm", "../package/main.wasm", os_copy_overwrite);
if (ok != 0) return ok;
}
cache_save();
return ok;
}