Last active
November 1, 2023 23:32
-
-
Save nektro/a28d4aadca050d32ab8ea5723bcb6739 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
pub fn build(b: *std.Build) void { | |
const target = b.standardTargetOptions(.{}); | |
const optimize = b.standardOptimizeOption(.{}); | |
const exe = b.addExecutable(.{ | |
.name = "test", | |
.root_source_file = .{ .path = "main.zig" }, | |
.target = target, | |
.optimize = optimize, | |
}); | |
const langs_dep = b.dependency("languages", .{}); | |
exe.addModule("iso-639-languages", langs_dep.module("iso-639-languages")); | |
b.installArtifact(exe); | |
const run_cmd = b.addRunArtifact(exe); | |
run_cmd.step.dependOn(b.getInstallStep()); | |
if (b.args) |args| { | |
run_cmd.addArgs(args); | |
} | |
const run_step = b.step("run", "Run the app"); | |
run_step.dependOn(&run_cmd.step); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.{ | |
.name = "zig17818", | |
.version = "0.0.1", | |
.dependencies = .{ | |
.languages = .{ | |
.url = "https://github.com/nektro/zig-iso-639-languages/archive/f0cd4a8f19d8791335b7a0940212e4073fa645a6.tar.gz", | |
.hash = "122066b0071358166df838aa57ccdfcd239949e2a2bed0fa701f8b744c054c34253d", | |
.build_file = "build.zig.zig", | |
}, | |
}, | |
.paths = .{ | |
".", | |
}, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
const langs = @import("iso-639-languages"); | |
pub fn main() !void { | |
std.log.info("{d}", .{std.meta.fields(langs.Alpha2Code).len}); | |
std.log.info("{d}", .{std.meta.fields(langs.Alpha3Code).len}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment