0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00
zig/test/link
Andrew Kelley b92e30ff0b std.Build.ResolvedTarget: rename target field to result
This change is seemingly insignificant but I actually agonized over this
for three days. Some other things I considered:

* (status quo in master branch) make Compile step creation functions
  accept a Target.Query and delete the ResolvedTarget struct.
  - downside: redundantly resolve target queries many times
* same as before but additionally add a hash map to cache target query
  resolutions.
  - downside: now there is a hash map that doesn't actually need to
    exist, just to make the API more ergonomic.
* add is_native_os and is_native_abi fields to std.Target and use it
  directly as the result of resolving a target query.
  - downside: they really don't belong there. They would be available
    as comptime booleans via `@import("builtin")` but they should not
    be exposed that way.

With this change the downsides are:
* the option name of addExecutable and friends is `target` instead of
  `resolved_target` matching the type name.
  - upside: this does not break compatibility with existing build
    scripts
* you likely end up seeing `target.result.cpu.arch` rather than
  `target.cpu.arch`.
  - upside: this is an improvement over `target.target.cpu.arch` which
    it was before this commit.
  - downside: `b.host.target` is now `b.host.result`.
History 2024-01-01 17:51:18 -07:00
..
bss zig build system: change target, compilation, and module APIs 2024-01-01 17:51:18 -07:00
common_symbols zig build system: change target, compilation, and module APIs 2024-01-01 17:51:18 -07:00
common_symbols_alignment zig build system: change target, compilation, and module APIs 2024-01-01 17:51:18 -07:00
glibc_compat rename std.zig.CrossTarget to std.Target.Query 2024-01-01 17:51:18 -07:00
interdependent_static_c_libs zig build system: change target, compilation, and module APIs 2024-01-01 17:51:18 -07:00
macho std.Build.ResolvedTarget: rename target field to result 2024-01-01 17:51:18 -07:00
static_libs_from_object_files zig build system: change target, compilation, and module APIs 2024-01-01 17:51:18 -07:00
wasm zig build system: change target, compilation, and module APIs 2024-01-01 17:51:18 -07:00
elf.zig std.Build.ResolvedTarget: rename target field to result 2024-01-01 17:51:18 -07:00
link.zig std.Build.ResolvedTarget: rename target field to result 2024-01-01 17:51:18 -07:00
macho.zig rename std.zig.CrossTarget to std.Target.Query 2024-01-01 17:51:18 -07:00