diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2024-09-18 23:00:20 +0200 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2024-09-18 23:00:20 +0200 |
| commit | 6e63960189e4e3e374e6956f6c86f561fc3df61a (patch) | |
| tree | eabe087bca05cd4703f949a016e3d5405a735695 /zig-os-props | |
| parent | 0fe94b0237bf1ef0212e129abfb56019d3e1c361 (diff) | |
| download | probe-6e63960189e4e3e374e6956f6c86f561fc3df61a.tar.gz | |
Added example of detecting OS props for target operating system
Diffstat (limited to 'zig-os-props')
| -rw-r--r-- | zig-os-props/Makefile | 2 | ||||
| -rw-r--r-- | zig-os-props/main.zig | 10 |
2 files changed, 12 insertions, 0 deletions
diff --git a/zig-os-props/Makefile b/zig-os-props/Makefile new file mode 100644 index 0000000..b962fd1 --- /dev/null +++ b/zig-os-props/Makefile @@ -0,0 +1,2 @@ +default: + zig run main.zig diff --git a/zig-os-props/main.zig b/zig-os-props/main.zig new file mode 100644 index 0000000..51665bf --- /dev/null +++ b/zig-os-props/main.zig @@ -0,0 +1,10 @@ +const std = @import("std"); +const builtin = @import("builtin"); + +pub fn main() void { + std.debug.print("os: {any}\n", .{builtin.target.os.tag}); + std.debug.print("arch: {any}\n", .{builtin.target.cpu.arch}); + std.debug.print("gnu: {any}\n", .{builtin.target.isGnu()}); + std.debug.print("musl: {any}\n", .{builtin.target.isMusl()}); + std.debug.print("mingw: {any}\n", .{builtin.target.isMinGW()}); +} |
