link directive
This commit is contained in:
@@ -46,6 +46,9 @@ intern_strict = l->intern("strict"_s);
|
||||
intern_void = l->intern("void"_s);
|
||||
intern_flag = l->intern("flag"_s);
|
||||
intern_it = l->intern("it"_s);
|
||||
intern_load = l->intern("load"_s);
|
||||
intern_import = l->intern("import"_s);
|
||||
intern_link = l->intern("link"_s);
|
||||
op_info_table[0].op = l->intern("*"_s);
|
||||
op_info_table[1].op = l->intern("/"_s);
|
||||
op_info_table[2].op = l->intern("%"_s);
|
||||
@@ -309,12 +312,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 -Wno-parentheses-equality -g -o a.out");
|
||||
// String compiler_call = string_fmt(scratch, "tcc program.c -Wall -g -o a.out");
|
||||
#endif
|
||||
String_Builder builder = {scratch};
|
||||
builder.addf("clang program.c -Wall -Wno-unused-function -Wno-parentheses-equality -g -o a" OS_EXE " ");
|
||||
Iter(&pctx->files_to_link){
|
||||
builder.addf("-l%Q ", it.item[0]->intern_val);
|
||||
}
|
||||
String compiler_call = string_flatten(scratch, &builder);
|
||||
|
||||
log_trace("%Q", compiler_call);
|
||||
system((const char *)compiler_call.str);
|
||||
F64 end = os_time();
|
||||
|
||||
Reference in New Issue
Block a user