linux
This commit is contained in:
48
build_file.c
48
build_file.c
@@ -17,6 +17,12 @@
|
||||
#include "src/wasm_app/wasm_app.meta.c"
|
||||
#include "src/testing/testing.meta.c"
|
||||
|
||||
#if PLATFORM_WINDOWS
|
||||
#define py "py "
|
||||
#else
|
||||
#define py "python3 "
|
||||
#endif
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
core_init();
|
||||
int ok = 0;
|
||||
@@ -28,7 +34,7 @@ int main(int argc, char **argv) {
|
||||
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_systemf(py "core_math_gen.py");
|
||||
os_set_working_dir("../../build");
|
||||
}
|
||||
mt_ui(tcx->temp);
|
||||
@@ -38,10 +44,10 @@ int main(int argc, char **argv) {
|
||||
mt_testing(tcx->temp);
|
||||
|
||||
b32 run_server = false;
|
||||
b32 core_test_target = false;
|
||||
b32 core_test_target = true;
|
||||
b32 win32_target = false;
|
||||
b32 standalone_w32_target = false;
|
||||
b32 wasm_target = true;
|
||||
b32 wasm_target = false;
|
||||
|
||||
if (run_server) {
|
||||
os_systemf("start /D ..\\package ..\\package\\run_server.bat");
|
||||
@@ -80,18 +86,30 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
|
||||
if (core_test_target && cache_code_modified(s8_lit("../src/testing/testing_main.c"), s8_lit("testing.exe"))) {
|
||||
os_delete_file(s8_lit("testing.pdb"));
|
||||
ok = os_systemf(
|
||||
"cl ../src/testing/testing_main.c -Fe:testing.exe -Fd:testing.pdb"
|
||||
" -I ../src"
|
||||
" /Zi /FC /nologo /Oi"
|
||||
" /WX /W3 /wd4200 /diagnostics:column"
|
||||
" /link /incremental:no /DEBUG:FULL"
|
||||
);
|
||||
if (ok != 0) return ok;
|
||||
if (PLATFORM_WINDOWS) {
|
||||
os_delete_file(s8_lit("testing.pdb"));
|
||||
ok = os_systemf(
|
||||
"cl ../src/testing/testing_main.c -Fe:testing.exe -Fd:testing.pdb"
|
||||
" -I ../src"
|
||||
" /Zi /FC /nologo /Oi"
|
||||
" /WX /W3 /wd4200 /diagnostics:column"
|
||||
" /link /incremental:no /DEBUG:FULL"
|
||||
);
|
||||
if (ok != 0) return ok;
|
||||
|
||||
ok = os_systemf("testing.exe");
|
||||
if (ok != 0) return ok;
|
||||
ok = os_systemf("testing.exe");
|
||||
if (ok != 0) return ok;
|
||||
} else {
|
||||
ok = os_systemf(
|
||||
"clang ../src/testing/testing_main.c -o testing.exe -g -I ../src"
|
||||
" -fdiagnostics-absolute-paths -Wno-unsequenced"
|
||||
" -lm -ldl"
|
||||
);
|
||||
if (ok != 0) return ok;
|
||||
|
||||
ok = os_systemf("./testing.exe");
|
||||
if (ok != 0) return ok;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -103,7 +121,7 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
if (wasm_code_modified) {
|
||||
ok = os_systemf(
|
||||
"clang.exe ../src/wasm_app/main.c -o main.wasm"
|
||||
"clang ../src/wasm_app/main.c -o main.wasm"
|
||||
" -Oz -g -I../src"
|
||||
" -Wall -Wno-missing-braces -Wno-single-bit-bitfield-constant-conversion -Wno-unsequenced -Wno-initializer-overrides"
|
||||
" -fdiagnostics-absolute-paths -fdiagnostics-format=msvc"
|
||||
|
||||
Reference in New Issue
Block a user