diff options
| author | Felix (xq) Queißner <git@mq32.de> | 2020-09-30 22:30:35 +0200 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-10-05 00:27:42 -0400 |
| commit | dce74c31cc95cc75d8eecbe9894add2785fc10ed (patch) | |
| tree | 1c5b464b40fa5aaba68eea5fe01dd0d3cb612cfe /src/Compilation.zig | |
| parent | 33bc1ebe37ef6ba5dfe73e458d662b5b516723ba (diff) | |
| download | zig-dce74c31cc95cc75d8eecbe9894add2785fc10ed.tar.gz zig-dce74c31cc95cc75d8eecbe9894add2785fc10ed.zip | |
Depending on system libs only enforces libraries to require dynamic linking, but neither static libs nor object files.
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index 1085e2d779..2ebc1b830d 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -478,8 +478,12 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation { { break :dl true; } - if (options.system_libs.len != 0) - break :dl true; + if (options.system_libs.len != 0) { + // when creating a executable that links to system libraries, + // we require dynamic linking, but we must not link static libraries + // or object files dynamically! + break :dl (options.output_mode == .Exe); + } break :dl false; }; |
