zig/lib
Ryan Liptak 9c9d3931df Trick the meson build system into thinking zig rc is rc.exe
When determining the type of RC compiler, meson passes `/?` or `--version` and then reads from `stdout` looking for particular string(s) anywhere in the output.

So, by adding the string "Microsoft Resource Compiler" to the `/?` output, meson will recognize `zig rc` as rc.exe and give it the correct options, which works fine since `zig rc` is drop-in CLI compatible with rc.exe.

This allows using `zig rc` with meson for (cross-)compiling, by either:

- Setting WINDRES="zig rc" or putting windres = ['zig', 'rc'] in the cross-file
  + This will work like rc.exe, so it will output .res files. This will only link successfully if you are using a linker that can do .res -> .obj conversion (so something like zig cc, MSVC, lld)
- Setting WINDRES="zig rc /:output-format coff" or putting windres = ['zig', 'rc', '/:output-format', 'coff'] in the cross-file
  + This will make meson pass flags as if it were rc.exe, but it will cause the resulting .res file to actually be a COFF object file, meaning it will work with any linker that handles COFF object files

Example cross file that uses `zig cc` (which can link `.res` files, so `/:output-format coff` is not necessary) and `zig rc`:

```
[binaries]
c = ['zig', 'cc', '--target=x86_64-windows-gnu']
windres = ['zig', 'rc']

[target_machine]
system = 'windows'
cpu_family = 'x86_64'
cpu = 'x86_64'
endian = 'little'
```
2025-03-21 18:07:16 -04:00
..
compiler Trick the meson build system into thinking zig rc is rc.exe 2025-03-21 18:07:16 -04:00
compiler_rt compiler-rt: fix signed min int from float 2025-03-08 14:21:22 -05:00
docs std.zig.Ast: improve type safety 2025-03-07 22:22:01 +01:00
fuzzer/web Replace deprecated default initializations with decl literals 2024-09-12 16:01:23 +01:00
include zig cc: Remove headers related to GPU offload. 2024-12-16 04:36:57 +01:00
init zig init template: remove outdated comments 2025-03-01 16:11:59 -08:00
libc glibc: fix uninitialized memory in __pthread_cond_s for <=2.40 2025-03-13 20:23:27 +00:00
libcxx libcxx: Update to LLVM 19.1.0. 2024-09-19 18:20:22 -07:00
libcxxabi libcxxabi: Update to LLVM 19. 2024-09-19 18:20:21 -07:00
libunwind libunwind: Fix compilation for the x32 ABI. 2024-11-18 17:43:54 +01:00
std compiler: Support more GCC code models and fix the mapping to LLVM code models. 2025-03-19 03:15:16 +01:00
tsan tsan: Update to LLVM 19.1.0. 2024-09-24 23:58:21 -07:00
c.zig Remove uses of deprecated callconv aliases 2025-03-05 03:01:43 +00:00
compiler_rt.zig x86_64: rewrite scalar and vector int @divTrunc 2025-02-15 03:45:21 -05:00
fuzzer.zig Remove uses of deprecated callconv aliases 2025-03-05 03:01:43 +00:00
ubsan_rt.zig ubsan: update wording 2025-02-25 11:22:33 -08:00
zig.h cbe: Implement support for -fno-builtin and @disableIntrinsics(). 2025-02-23 04:08:58 +01:00