╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ dev.zig ──────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭ find file ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╮ ╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │ │ │http│ ssh │ │ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╯ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
320 spork8_backend, 321 322 lld_linker, 323 coff_linker, 324 coff2_linker, 325 elf_linker, 326 elf2_linker, 327 macho_linker, 328 c_linker, 329 wasm_linker, 330 spirv_linker, 331 plan9_linker, 332 spork8_linker, 333 }; 334 335 /// Makes the code following the call to this function unreachable if `feature` is disabled. 336 pub fn check(comptime feature: Feature) if (env.supports(feature)) void else noreturn { 337 if (env.supports(feature)) return; 338 @panic("development environment " ++ @tagName(env) ++ " does not support feature " ++ @tagName(feature)); 339 } 340 341 /// Makes the code following the call to this function unreachable if all of `features` are disabled. 342 pub fn checkAny(comptime features: []const Feature) if (env.supportsAny(features)) void else noreturn { 343 if (env.supportsAny(features)) return; 344 comptime var feature_tags: []const u8 = ""; 345 inline for (features[0 .. features.len - 1]) |feature| feature_tags = feature_tags ++ @tagName(feature) ++ ", "; 346 feature_tags = feature_tags ++ "or " ++ @tagName(features[features.len - 1]); 347 @panic("development environment " ++ @tagName(env) ++ " does not support feature " ++ feature_tags); 348 } 349 350 /// Makes the code following the call to this function unreachable if any of `features` are disabled. 351 pub fn checkAll(comptime features: []const Feature) if (env.supportsAll(features)) void else noreturn { 352 if (env.supportsAll(features)) return; 353 inline for (features) |feature| if (!env.supports(feature)) 354 @panic("development environment " ++ @tagName(env) ++ " does not support feature " ++ @tagName(feature)); 355 } 356 357 const build_options = @import("build_options"); 358 359 pub const env: Env = if (@hasDecl(build_options, "dev")) 360 @field(Env, @tagName(build_options.dev)) 361 else if (@hasDecl(build_options, "only_c") and build_options.only_c) 362 .bootstrap 363 else if (@hasDecl(build_options, "only_core_functionality") and build_options.only_core_functionality) 364 .core 365 else 366 .full; 367