diff options
| author | gingerBill <bill@gingerbill.org> | 2023-03-21 13:30:58 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2023-03-21 13:30:58 +0000 |
| commit | 2c4a478987e030e0891b4e317b47886ac6fd06fe (patch) | |
| tree | 90fb62728e48bf369d2645b6a9e5d0851196bbdd /src/main.cpp | |
| parent | a80ca239374dff52d52d0e7c1ab7e60096f1991b (diff) | |
Add `@(extra_linker_flags=<string>)`
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index 82c20cfe6..bbb28cdf8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -278,6 +278,13 @@ gb_internal i32 linker_stage(lbGenerator *gen) { } } + for (Entity *e : gen->foreign_libraries) { + GB_ASSERT(e->kind == Entity_LibraryName); + if (e->LibraryName.extra_linker_flags.len != 0) { + lib_str = gb_string_append_fmt(lib_str, " %.*s", LIT(e->LibraryName.extra_linker_flags)); + } + } + if (build_context.build_mode == BuildMode_DynamicLibrary) { link_settings = gb_string_append_fmt(link_settings, " /DLL"); } else { @@ -449,6 +456,12 @@ gb_internal i32 linker_stage(lbGenerator *gen) { } } + for (Entity *e : gen->foreign_libraries) { + GB_ASSERT(e->kind == Entity_LibraryName); + if (e->LibraryName.extra_linker_flags.len != 0) { + lib_str = gb_string_append_fmt(lib_str, " %.*s", LIT(e->LibraryName.extra_linker_flags)); + } + } gbString object_files = gb_string_make(heap_allocator(), ""); defer (gb_string_free(object_files)); |