mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
Compilation.Config: eliminate the only variable from this function
This commit is contained in:
parent
2387305b23
commit
d6b1ff7533
@ -318,14 +318,6 @@ pub fn resolve(options: Options) ResolveError!Config {
|
||||
break :b false;
|
||||
};
|
||||
|
||||
var link_libunwind = b: {
|
||||
if (link_libcpp and target_util.libCxxNeedsLibUnwind(target)) {
|
||||
if (options.link_libunwind == false) return error.LibCppRequiresLibUnwind;
|
||||
break :b true;
|
||||
}
|
||||
break :b options.link_libunwind orelse false;
|
||||
};
|
||||
|
||||
const link_libc = b: {
|
||||
if (target_util.osRequiresLibC(target)) {
|
||||
if (options.link_libc == false) return error.OsRequiresLibC;
|
||||
@ -335,7 +327,7 @@ pub fn resolve(options: Options) ResolveError!Config {
|
||||
if (options.link_libc == false) return error.LibCppRequiresLibC;
|
||||
break :b true;
|
||||
}
|
||||
if (link_libunwind) {
|
||||
if (options.link_libunwind == true) {
|
||||
if (options.link_libc == false) return error.LibUnwindRequiresLibC;
|
||||
break :b true;
|
||||
}
|
||||
@ -406,12 +398,17 @@ pub fn resolve(options: Options) ResolveError!Config {
|
||||
break :b .static;
|
||||
};
|
||||
|
||||
// This is done here to avoid excessive duplicated logic due to the complex dependencies between these options.
|
||||
if (options.output_mode == .Exe and link_libc and target_util.libCNeedsLibUnwind(target, link_mode)) {
|
||||
if (options.link_libunwind == false) return error.LibCRequiresLibUnwind;
|
||||
|
||||
link_libunwind = true;
|
||||
}
|
||||
const link_libunwind = b: {
|
||||
if (options.output_mode == .Exe and link_libc and target_util.libCNeedsLibUnwind(target, link_mode)) {
|
||||
if (options.link_libunwind == false) return error.LibCRequiresLibUnwind;
|
||||
break :b true;
|
||||
}
|
||||
if (link_libcpp and target_util.libCxxNeedsLibUnwind(target)) {
|
||||
if (options.link_libunwind == false) return error.LibCppRequiresLibUnwind;
|
||||
break :b true;
|
||||
}
|
||||
break :b options.link_libunwind orelse false;
|
||||
};
|
||||
|
||||
const import_memory = options.import_memory orelse (options.output_mode == .Obj);
|
||||
const export_memory = b: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user