Skip to content

Commit 0677503

Browse files
committed
make config option enum type for iconv-impl public
1 parent a0e9ec3 commit 0677503

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const libxml2_dependency = b.dependency("libxml2", .{
3535
// .iconv = !(target.query.isNativeOs() and target.result.os.tag.isDarwin()),
3636
3737
// Use GNU libiconv on macOS which is licensed under LGPL.
38-
// .@"iconv-impl" = if (target.result.os.tag.isDarwin()) else null,
38+
// .@"iconv-impl" = @as(?enum{libc, libiconv, win_iconv}, if (target.result.os.tag.isDarwin()) .libiconv else null),
3939
});
4040
your_exe.linkLibrary(libxml2_dependency.artifact("xml"));
4141
```

‎build.zig‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
const std = @import("std");
22

3+
pub const IconvImpl = enum { libc, libiconv, win_iconv };
4+
35
pub fn build(b: *std.Build) void {
46
const upstream = b.dependency("libxml2", .{});
57
const target = b.standardTargetOptions(.{});
@@ -184,7 +186,6 @@ pub fn build(b: *std.Build) void {
184186
if (b.systemIntegrationOption("iconv", .{ .default = target.result.os.tag.isDarwin() })) {
185187
xml_lib.root_module.linkSystemLibrary("iconv", .{});
186188
} else {
187-
const IconvImpl = enum { libc, libiconv, win_iconv };
188189
const impl: IconvImpl = b.option(
189190
IconvImpl,
190191
"iconv-impl",

0 commit comments

Comments
 (0)