| author | |
| committer | |
| log | c390f55e727c8f4ace2eb7992403bf8332a22126 |
| tree | 4a01d3509a06a6dce19ea8830f1b4319c0682680 |
| parent | 0cf6ae290b97e7fee7e37b5c487fd3e6b35248b3 |
| signature |
4 files changed, 51 insertions(+), 0 deletions(-)
test/standalone/build.zig.zon+3| ... | @@ -186,6 +186,9 @@ | ... | @@ -186,6 +186,9 @@ |
| 186 | .omit_cfi = .{ | 186 | .omit_cfi = .{ |
| 187 | .path = "omit_cfi", | 187 | .path = "omit_cfi", |
| 188 | }, | 188 | }, |
| 189 | .config_header = .{ | ||
| 190 | .path = "config_header", | ||
| 191 | }, | ||
| 189 | }, | 192 | }, |
| 190 | .paths = .{ | 193 | .paths = .{ |
| 191 | "build.zig", | 194 | "build.zig", |
test/standalone/config_header/build.zig created+22| ... | @@ -0,0 +1,22 @@ | ||
| 1 | const std = @import("std"); | ||
| 2 | |||
| 3 | pub fn build(b: *std.Build) void { | ||
| 4 | const config_header = b.addConfigHeader( | ||
| 5 | .{ .style = .{ .autoconf = b.path("config.h.in") } }, | ||
| 6 | .{ | ||
| 7 | .SOME_NO = null, | ||
| 8 | .SOME_TRUE = true, | ||
| 9 | .SOME_FALSE = false, | ||
| 10 | .SOME_ZERO = 0, | ||
| 11 | .SOME_ONE = 1, | ||
| 12 | .SOME_TEN = 10, | ||
| 13 | .SOME_ENUM_LITERAL = .@"test", | ||
| 14 | .SOME_STRING = "test", | ||
| 15 | }, | ||
| 16 | ); | ||
| 17 | |||
| 18 | const check_config_header = b.addCheckFile(config_header.getOutput(), .{ .expected_exact = @embedFile("config.h") }); | ||
| 19 | |||
| 20 | const test_step = b.step("test", "Test it"); | ||
| 21 | test_step.dependOn(&check_config_header.step); | ||
| 22 | } | ||
test/standalone/config_header/config.h created+14| ... | @@ -0,0 +1,14 @@ | ||
| 1 | /* This file was generated by ConfigHeader using the Zig Build System. */ | ||
| 2 | /* Some Comment */ | ||
| 3 | |||
| 4 | int foo(); | ||
| 5 | |||
| 6 | /* #undef SOME_NO */ | ||
| 7 | #define SOME_TRUE 1 | ||
| 8 | #define SOME_FALSE 0 | ||
| 9 | #define SOME_ZERO 0 | ||
| 10 | #define SOME_ONE 1 | ||
| 11 | #define SOME_TEN 10 | ||
| 12 | #define SOME_ENUM_LITERAL test | ||
| 13 | #define SOME_STRING "test" | ||
| 14 | |||
test/standalone/config_header/config.h.in created+12| ... | @@ -0,0 +1,12 @@ | ||
| 1 | /* Some Comment */ | ||
| 2 | |||
| 3 | int foo(); | ||
| 4 | |||
| 5 | #undef SOME_NO | ||
| 6 | #undef SOME_TRUE | ||
| 7 | #undef SOME_FALSE | ||
| 8 | #undef SOME_ZERO | ||
| 9 | #undef SOME_ONE | ||
| 10 | #undef SOME_TEN | ||
| 11 | #undef SOME_ENUM_LITERAL | ||
| 12 | #undef SOME_STRING | ||