mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
Adds `addFileContentArg` and `addPrefixedFileContentArg` to pass the content of a file with a lazy path as an argument to a `std.Build.Step.Run`. This enables replicating shell `$()` / cmake `execute_process` with `OUTPUT_VARIABLE` as an input to another `execute_process` in conjuction with `captureStdOut`/`captureStdErr`. To also be able to replicate `$()` automatically trimming trailing newlines and cmake `OUTPUT_STRIP_TRAILING_WHITESPACE`, this patch adds an `options` arg to those functions which allows specifying the desired handling of surrounding whitespace. The `options` arg also allows to specify a custom `basename` for the output. e.g. to add a file extension (concrete use case: Zig `@import()` requires files to have a `.zig`/`.zon` extension to recognize them as valid source files). |
||
|---|---|---|
| .. | ||
| behavior | ||
| c_abi | ||
| c_import | ||
| cases | ||
| incremental | ||
| link | ||
| src | ||
| standalone | ||
| behavior.zig | ||
| c_import.zig | ||
| cases.zig | ||
| compile_errors.zig | ||
| gen_h.zig | ||
| llvm_ir.zig | ||
| llvm_targets.zig | ||
| nvptx.zig | ||
| run_translated_c.zig | ||
| stack_traces.zig | ||
| tests.zig | ||
| translate_c.zig | ||