win32_app

This commit is contained in:
krzosa
2025-01-03 07:53:13 +01:00
parent 05d49eefe8
commit 6933566a86
17 changed files with 832 additions and 200 deletions

View File

@@ -9,16 +9,51 @@
#include "src/app/app.meta.c"
void list_files_recursive(sb8_t *sb, s8_t path) {
for (OS_FileIter iter = OS_IterateFiles(&Perm, path); OS_IsValid(iter); OS_Advance(&iter)) {
if (iter.is_directory) {
list_files_recursive(sb, iter.absolute_path);
} else {
sb8_append(sb, iter.absolute_path);
}
}
}
int main(int argc, char **argv) {
int ok = 0;
ma_arena_t *arena = ma_create(ma_default_reserve_size);
meta_app(arena);
bool execute_python_snippets = true; // make sure to not abuse just for quick maths
bool run_server = false;
bool core_test_target = false;
bool wasm_target = true;
bool win32_target = false;
bool wasm_target = false;
bool win32_target = true;
if (execute_python_snippets) {
sb8_t *sb = sb8_serial_begin(arena);
list_files_recursive(sb, s8_lit(".."));
for (sb8_node_t *it = sb->first; it; it = it->next) {
s8_t abs = it->string;
bool is_c_file = s8_ends_with(abs, s8_lit(".c"), true) || s8_ends_with(abs, s8_lit(".cpp"), true) || s8_ends_with(abs, s8_lit(".h"), true) || s8_ends_with(abs, s8_lit(".hpp"), true);
if (!is_c_file) {
continue;
}
bool is_build_file = s8_ends_with(abs, s8_lit("build_file.c"), true);
if (is_build_file) {
continue;
}
s8_t file = OS_ReadFile(&Perm, abs);
i64 idx = s8_find(file, s8_lit("/*#"), 0);
if (idx != -1) {
os_systemf("\"D:\\dev\\apps\\bin\\pyorun.bat\" %s", abs.str);
}
}
}
if (run_server) {
os_systemf("start /D ..\\package ..\\package\\run_server.bat");