mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 12:27:41 +00:00
frontend: make dll_export_fns=false on non-windows
Fixes a regression introduced in this branch.
This commit is contained in:
parent
476484f09c
commit
791e83c223
@ -138,6 +138,7 @@ pub const ResolveError = error{
|
||||
LlvmLibraryUnavailable,
|
||||
LldUnavailable,
|
||||
ClangUnavailable,
|
||||
DllExportFnsRequiresWindows,
|
||||
};
|
||||
|
||||
pub fn resolve(options: Options) ResolveError!Config {
|
||||
@ -459,6 +460,11 @@ pub fn resolve(options: Options) ResolveError!Config {
|
||||
const rdynamic = options.rdynamic orelse false;
|
||||
|
||||
const dll_export_fns = b: {
|
||||
if (target.os.tag != .windows) {
|
||||
if (options.dll_export_fns == true)
|
||||
return error.DllExportFnsRequiresWindows;
|
||||
break :b false;
|
||||
}
|
||||
if (options.dll_export_fns) |x| break :b x;
|
||||
if (rdynamic) break :b true;
|
||||
break :b switch (options.output_mode) {
|
||||
|
||||
@ -3842,8 +3842,8 @@ fn createModule(
|
||||
create_module.opts.any_dyn_libs = true;
|
||||
|
||||
create_module.resolved_options = Compilation.Config.resolve(create_module.opts) catch |err| switch (err) {
|
||||
error.WasiExecModelRequiresWasi => fatal("execution model only allowed for WASI OS targets", .{}),
|
||||
error.SharedMemoryIsWasmOnly => fatal("shared memory only allowed for WebAssembly CPU targets", .{}),
|
||||
error.WasiExecModelRequiresWasi => fatal("only WASI OS targets support execution model", .{}),
|
||||
error.SharedMemoryIsWasmOnly => fatal("only WebAssembly CPU targets support shared memory", .{}),
|
||||
error.ObjectFilesCannotShareMemory => fatal("object files cannot share memory", .{}),
|
||||
error.SharedMemoryRequiresAtomicsAndBulkMemory => fatal("shared memory requires atomics and bulk_memory CPU features", .{}),
|
||||
error.ThreadsRequireSharedMemory => fatal("threads require shared memory", .{}),
|
||||
@ -3869,6 +3869,7 @@ fn createModule(
|
||||
error.LlvmLibraryUnavailable => fatal("zig was compiled without LLVM libraries", .{}),
|
||||
error.LldUnavailable => fatal("zig was compiled without LLD libraries", .{}),
|
||||
error.ClangUnavailable => fatal("zig was compiled without Clang libraries", .{}),
|
||||
error.DllExportFnsRequiresWindows => fatal("only Windows OS targets support DLLs", .{}),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user