diff options
| author | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2026-01-22 11:47:23 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-22 11:47:23 +0100 |
| commit | 3f8a32aeb963e056ac7709c26f05a99fb884ef95 (patch) | |
| tree | 4eed35fa23e9f4c5b7dedc6a355b16f5d3119661 /src/linker.cpp | |
| parent | fb479b3aaec5a9a715bcff7d65498ba18020f4f0 (diff) | |
| parent | 5c09550d383df49a1d29d8f66bc1c45ee3be1136 (diff) | |
Merge branch 'master' into xmlcomment
Diffstat (limited to 'src/linker.cpp')
| -rw-r--r-- | src/linker.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/linker.cpp b/src/linker.cpp index c2a3ee928..c68417994 100644 --- a/src/linker.cpp +++ b/src/linker.cpp @@ -737,7 +737,21 @@ try_cross_linking:; } if (build_context.build_mode == BuildMode_StaticLibrary) { - compiler_error("TODO(bill): -build-mode:static on non-windows targets"); + TIME_SECTION("Static Library Creation"); + + gbString ar_command = gb_string_make(heap_allocator(), ""); + defer (gb_string_free(ar_command)); + + ar_command = gb_string_appendc(ar_command, "ar rcs "); + ar_command = gb_string_append_fmt(ar_command, "\"%.*s\" ", LIT(output_filename)); + ar_command = gb_string_appendc(ar_command, object_files); + + result = system_exec_command_line_app("ar", ar_command); + if (result) { + return result; + } + + return result; } // NOTE(dweiler): We use clang as a frontend for the linker as there are |