Ported to Linux!

This commit is contained in:
Krzosa Karol
2022-10-09 12:23:38 +02:00
parent 0637a32655
commit ee6f8114ee
5 changed files with 62 additions and 19 deletions

View File

@@ -309,7 +309,13 @@ compile_file(String filename, U32 compile_flags = COMPILE_NULL){
Scratch scratch;
F64 begin = os_time();
#if OS_WINDOWS
String compiler_call = string_fmt(scratch, "clang.exe program.c -Wall -Wno-unused-function -Wno-parentheses-equality -g -o a.exe -lgdi32 -luser32 -lwinmm");
#else
String compiler_call = string_fmt(scratch, "clang program.c -std=c99 -Wall -Wno-unused-function -g -o a.out");
// String compiler_call = string_fmt(scratch, "tcc program.c -Wall -g -o a.out");
#endif
log_trace("%Q", compiler_call);
system((const char *)compiler_call.str);
F64 end = os_time();
@@ -332,7 +338,11 @@ compile_file(String filename, U32 compile_flags = COMPILE_NULL){
if(is_flag_set(compile_flags, COMPILE_AND_RUN)){
String testing = compile_flags&COMPILE_TESTING ? "testing"_s : ""_s;
#if OS_WINDOWS
String sys = string_fmt(scratch, "a.exe %Q", testing);
#else
String sys = string_fmt(scratch, "./a.out %Q", testing);
#endif
int result = system((char *)sys.str);
assert(result != -1);
if(result == 0){