diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-12-15 19:25:34 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2024-01-01 17:51:20 -0700 |
| commit | 638db680f4c6380bb193da520f29a7c587bfb719 (patch) | |
| tree | c1b813f52c7970b061e928e8c7b9e0d859a82ded /src/Compilation/Config.zig | |
| parent | b54ad9317591873159594e673953088a21d66e7b (diff) | |
| download | zig-638db680f4c6380bb193da520f29a7c587bfb719.tar.gz zig-638db680f4c6380bb193da520f29a7c587bfb719.zip | |
move dll_export_fns and rdynamic to Compilation.Config
Diffstat (limited to 'src/Compilation/Config.zig')
| -rw-r--r-- | src/Compilation/Config.zig | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/Compilation/Config.zig b/src/Compilation/Config.zig index 44ace55ae4..442b7a1b9a 100644 --- a/src/Compilation/Config.zig +++ b/src/Compilation/Config.zig @@ -41,6 +41,8 @@ entry: ?[]const u8, debug_format: DebugFormat, root_strip: bool, root_error_tracing: bool, +dll_export_fns: bool, +rdynamic: bool, pub const CFrontend = enum { clang, aro }; @@ -93,6 +95,8 @@ pub const Options = struct { shared_memory: ?bool = null, test_evented_io: bool = false, debug_format: ?Config.DebugFormat = null, + dll_export_fns: ?bool = null, + rdynamic: ?bool = null, }; pub fn resolve(options: Options) !Config { @@ -415,6 +419,17 @@ pub fn resolve(options: Options) !Config { const any_error_tracing = root_error_tracing or options.any_error_tracing; + const rdynamic = options.rdynamic orelse false; + + const dll_export_fns = b: { + if (options.dll_export_fns) |x| break :b x; + if (rdynamic) break :b true; + break :b switch (options.output_mode) { + .Obj, .Exe => false, + .Lib => link_mode == .Dynamic, + }; + }; + return .{ .output_mode = options.output_mode, .have_zcu = options.have_zcu, @@ -443,6 +458,8 @@ pub fn resolve(options: Options) !Config { .wasi_exec_model = wasi_exec_model, .debug_format = debug_format, .root_strip = root_strip, + .dll_export_fns = dll_export_fns, + .rdynamic = rdynamic, }; } |
