Canonical Cross Compiling w/ System Dependencies, PKG Config, --sysroot and --search-prefix?

a lot of projects use system dependencies - link xy.so or parse xy.h.
some build steps even include host-tools-with-system-dependencies.

As i understand the zig build system has following mechanisms:

per module/step:

  • addIncludePath, similar to -I, populates headers
  • addLibraryPath similar to -L, populates libraries
  • addSystemFrameworkPath similar to -F, populates frameworks
  • linkSystemLibrary (this actually links a system library i.e. x11 but uses pkg-config under the hood to find libs on the (host!) system enabled by default, falls back to library paths)

whole build graph (affects dependencies):

  • –search-prefix, populates header and library lists, not translateC
  • –sysroot, redirects paths onto the root

–sysroot and --search-prefix are graph-wide and affect dependencies, but not translate-c, and also affect native host steps. --search-prefix is additive therefore harmless, but --sysroot re-roots every absolute library path onto the sysroot (/sdk + /sdk/usr/lib → /sdk/sdk/usr/lib), while deriving real paths only for Mach-O.
–sysroot fails on host-steps with sys dependencies, and --search-prefix on translate-c on system headers.

That leaves:

  • explicit .addInclude(include_path), Library, Framework with explicit build options i.e. -Dinclude_path=… -Dlibrary_path …
  • leave that out and set pkg-config cross paths via env environment (feels wrong)? is this really intended by zig and more importantly what happens with when a build tool with (host) system dependencies is used in the graph (does zig-pkg-config supply it with the native system dep when we also tell pkg-config to look in a sysroot for cross dependencies)?

Cross Compiling with system deps = my computer (the host) supplies the headers and binaries of the target

So here is my QUESTION:
What is the canonical/correct way to configure cross-compiling with system dependencies in build.zig?

p.s.
I dont get why pkgconfig is enabled in the first place since this leads to maintainers writing their buildscripts without cross compiling in mind, just linking in stuff right and left on their host machine, since it works