string16 improvements

This commit is contained in:
Krzosa Karol
2025-04-04 08:25:47 +02:00
parent f6d5a1cf81
commit f3aa52ba3d
34 changed files with 637 additions and 699 deletions

View File

@@ -24,12 +24,12 @@
#include "src/testing/testing.meta.c"
void build_testing_target(void) {
if (!cache_code_modified(s8_lit("../src/testing/testing_main.c"), s8_lit("testing.exe"))) {
if (!cache_code_modified(s8("../src/testing/testing_main.c"), s8("testing.exe"))) {
return;
}
if (PLATFORM_WINDOWS) {
os_delete_file(s8_lit("testing.pdb"));
os_delete_file(s8("testing.pdb"));
int ok = os_systemf(
"cl ../src/testing/testing_main.c -Fe:testing.exe -Fd:testing.pdb"
" -I ../src"
@@ -57,7 +57,7 @@ void build_testing_target(void) {
}
void build_win32_app_base_target(void) {
if (!cache_code_modified(s8_lit("../src/app/app_win32_exe.c"), s8_lit("app_win32.exe"))) {
if (!cache_code_modified(s8("../src/app/app_win32_exe.c"), s8("app_win32.exe"))) {
return;
}
int ok = os_systemf(
@@ -71,7 +71,7 @@ void build_win32_app_base_target(void) {
}
void build_text_editor_dll_target(void) {
if (!cache_code_modified(s8_lit("../src/text_editor/text_editor_main.c"), s8_lit("app.dll"))) {
if (!cache_code_modified(s8("../src/text_editor/text_editor_main.c"), s8("app.dll"))) {
return;
}
int ok = os_systemf(
@@ -85,7 +85,7 @@ void build_text_editor_dll_target(void) {
}
void build_prototype_dll_target(void) {
if (!cache_code_modified(s8_lit("../src/wasm_app/main.c"), s8_lit("app.dll"))) {
if (!cache_code_modified(s8("../src/wasm_app/main.c"), s8("app.dll"))) {
return;
}
int ok = os_systemf(
@@ -99,8 +99,8 @@ void build_prototype_dll_target(void) {
}
void build_prototype_wasm_target(void) {
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"));
b32 html_code_modified = cache_code_modified(s8("../src/app/app_wasm.html"), s8("../package/index.html"));
b32 wasm_code_modified = cache_code_modified(s8("../src/wasm_app/main.c"), s8("main.wasm"));
if (html_code_modified) {
os_copy("../src/app/app_wasm.html", "../package/index.html", os_copy_overwrite);
}
@@ -119,7 +119,7 @@ void build_prototype_wasm_target(void) {
}
void build_prototype_standalone_target(void) {
if (!cache_code_modified(s8_lit("../src/wasm_app/main.c"), s8_lit("standalone_app.exe"))) {
if (!cache_code_modified(s8("../src/wasm_app/main.c"), s8("standalone_app.exe"))) {
return;
}
@@ -134,7 +134,7 @@ void build_prototype_standalone_target(void) {
}
void generate_math_code(ma_arena_t *arena) {
if (!cache_code_modified(s8_lit("../src/core/core_math_gen.py"), s8_null)) {
if (!cache_code_modified(s8("../src/core/core_math_gen.py"), s8_null)) {
return;
}
@@ -153,9 +153,9 @@ int main(int argc, char **argv) {
core_init();
int ok = 0;
SRC_SearchPaths.include_path = (char*[]){OS_GetAbsolutePath(&Perm, s8_lit("../src")).str};
SRC_SearchPaths.include_path = (char*[]){OS_GetAbsolutePath(&Perm, s8("../src")).str};
SRC_SearchPaths.include_path_count = 1;
cache_init(&Perm, s8_lit("cache_build_file"));
cache_init(&Perm, s8("cache_build_file"));
generate_math_code(tcx->temp);
generate_ui_code(tcx->temp);
@@ -177,6 +177,10 @@ int main(int argc, char **argv) {
os_systemf("start /D ..\\package ..\\package\\run_server.bat");
}
if (run_testing_target) {
build_testing_target();
}
if (run_prototype_standalone_target) {
build_prototype_standalone_target();
}
@@ -193,10 +197,6 @@ int main(int argc, char **argv) {
build_text_editor_dll_target();
}
if (run_testing_target) {
build_testing_target();
}
if (run_prototype_wasm_target) {
build_prototype_wasm_target();
}