aboutsummaryrefslogtreecommitdiff
path: root/src/Compilation
diff options
context:
space:
mode:
authorVeikka Tuominen <git@vexu.eu>2024-03-11 22:42:32 +0200
committerGitHub <noreply@github.com>2024-03-11 22:42:32 +0200
commit4f782d1e853accbe1c4bfab2617c3813d4b1e59f (patch)
tree0eb768171ecfb058fba72d199afc951af206f8fb /src/Compilation
parentd0c06ca7127110a8afeb0ef524a197049892db21 (diff)
parent6067d39522f939c08dd3f3ea4fb5889ff0024e72 (diff)
downloadzig-4f782d1e853accbe1c4bfab2617c3813d4b1e59f.tar.gz
zig-4f782d1e853accbe1c4bfab2617c3813d4b1e59f.zip
Merge pull request #18994 from ExpidusOS/feat/container-layout-rename-fields
std.builtin: make enum fields lowercase
Diffstat (limited to 'src/Compilation')
-rw-r--r--src/Compilation/Config.zig24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/Compilation/Config.zig b/src/Compilation/Config.zig
index 2f6422b28a..d692fe5623 100644
--- a/src/Compilation/Config.zig
+++ b/src/Compilation/Config.zig
@@ -348,26 +348,26 @@ pub fn resolve(options: Options) ResolveError!Config {
const link_mode = b: {
const explicitly_exe_or_dyn_lib = switch (options.output_mode) {
.Obj => false,
- .Lib => (options.link_mode orelse .Static) == .Dynamic,
+ .Lib => (options.link_mode orelse .static) == .dynamic,
.Exe => true,
};
if (target_util.cannotDynamicLink(target)) {
- if (options.link_mode == .Dynamic) return error.TargetCannotDynamicLink;
- break :b .Static;
+ if (options.link_mode == .dynamic) return error.TargetCannotDynamicLink;
+ break :b .static;
}
if (explicitly_exe_or_dyn_lib and link_libc and
(target.isGnuLibC() or target_util.osRequiresLibC(target)))
{
- if (options.link_mode == .Static) return error.LibCRequiresDynamicLinking;
- break :b .Dynamic;
+ if (options.link_mode == .static) return error.LibCRequiresDynamicLinking;
+ break :b .dynamic;
}
// When creating a executable that links to system libraries, we
// require dynamic linking, but we must not link static libraries
// or object files dynamically!
if (options.any_dyn_libs and options.output_mode == .Exe) {
- if (options.link_mode == .Static) return error.SharedLibrariesRequireDynamicLinking;
- break :b .Dynamic;
+ if (options.link_mode == .static) return error.SharedLibrariesRequireDynamicLinking;
+ break :b .dynamic;
}
if (options.link_mode) |link_mode| break :b link_mode;
@@ -377,16 +377,16 @@ pub fn resolve(options: Options) ResolveError!Config {
{
// If targeting the system's native ABI and the system's libc is
// musl, link dynamically by default.
- break :b .Dynamic;
+ break :b .dynamic;
}
// Static is generally a better default. Fight me.
- break :b .Static;
+ break :b .static;
};
const import_memory = options.import_memory orelse (options.output_mode == .Obj);
const export_memory = b: {
- if (link_mode == .Dynamic) {
+ if (link_mode == .dynamic) {
if (options.export_memory == true) return error.ExportMemoryAndDynamicIncompatible;
break :b false;
}
@@ -397,7 +397,7 @@ pub fn resolve(options: Options) ResolveError!Config {
const pie: bool = b: {
switch (options.output_mode) {
.Obj, .Exe => {},
- .Lib => if (link_mode == .Dynamic) {
+ .Lib => if (link_mode == .dynamic) {
if (options.pie == true) return error.DynamicLibraryPrecludesPie;
break :b false;
},
@@ -467,7 +467,7 @@ pub fn resolve(options: Options) ResolveError!Config {
if (rdynamic) break :b true;
break :b switch (options.output_mode) {
.Obj, .Exe => false,
- .Lib => link_mode == .Dynamic,
+ .Lib => link_mode == .dynamic,
};
};