From 638db680f4c6380bb193da520f29a7c587bfb719 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 15 Dec 2023 19:25:34 -0700 Subject: move dll_export_fns and rdynamic to Compilation.Config --- src/Compilation/Config.zig | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/Compilation/Config.zig') 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, }; } -- cgit v1.2.3