Skip to content

Commit

Permalink
feat!: remove unicode from main branch
Browse files Browse the repository at this point in the history
This is beacuse Zig versions around 0.14.0-dev.2628+5b5c60f43 break the
unicode dependencies. Instead, moving the unicode work to a seperate
branch.
  • Loading branch information
fjebaker committed Jan 9, 2025
1 parent 69a8ef1 commit bf425e3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 314 deletions.
50 changes: 8 additions & 42 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -4,52 +4,19 @@ pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});

const zg = b.dependency("zg", .{
.target = target,
.optimize = optimize,
});

const with_unicode = b.option(
bool,
"unicode",
"Compile with unicode support (fetches additional dependencies)",
) orelse false;

const opts = b.addOptions();

opts.addOption(
bool,
"unicode",
with_unicode,
const mod = b.addModule(
"fuzzig",
.{
.root_source_file = b.path("src/root.zig"),
.target = target,
.optimize = optimize,
},
);

const mod = b.addModule("fuzzig", .{ .root_source_file = b.path("src/root.zig") });
mod.addOptions("options", opts);

if (with_unicode) {
mod.addImport("code_point", zg.module("code_point"));
mod.addImport("GenCatData", zg.module("GenCatData"));
mod.addImport("CaseData", zg.module("CaseData"));
mod.addImport("Normalize", zg.module("Normalize"));
mod.addImport("CaseFold", zg.module("CaseFold"));
}

const lib_unit_tests = b.addTest(.{
.root_source_file = b.path("src/root.zig"),
.target = target,
.optimize = optimize,
.root_module = mod,
});

lib_unit_tests.root_module.addOptions("options", opts);

if (with_unicode) {
lib_unit_tests.root_module.addImport("code_point", zg.module("code_point"));
lib_unit_tests.root_module.addImport("GenCatData", zg.module("GenCatData"));
lib_unit_tests.root_module.addImport("CaseData", zg.module("CaseData"));
lib_unit_tests.root_module.addImport("Normalize", zg.module("Normalize"));
lib_unit_tests.root_module.addImport("CaseFold", zg.module("CaseFold"));
}

const run_lib_unit_tests = b.addRunArtifact(lib_unit_tests);

const test_step = b.step("test", "Run unit tests");
Expand All @@ -61,7 +28,6 @@ pub fn build(b: *std.Build) void {
.target = target,
.optimize = optimize,
});

exe.root_module.addImport("fuzzig", mod);

const run_cmd = b.addRunArtifact(exe);
Expand Down
9 changes: 2 additions & 7 deletions build.zig.zon
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
.{
.name = "fuzzig",
.version = "0.1.0",
.dependencies = .{
.zg = .{
.url = "https://codeberg.org/dude_the_builder/zg/archive/v0.13.2.tar.gz",
.hash = "122055beff332830a391e9895c044d33b15ea21063779557024b46169fb1984c6e40",
},
},
.version = "0.1.1",
.dependencies = .{},
.paths = .{
"build.zig",
"build.zig.zon",
Expand Down
11 changes: 0 additions & 11 deletions src/root.zig
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,6 @@ const structures = @import("structures.zig");
const CharacterType = utils.CharacterType;
const MatrixT = structures.MatrixT;

pub const Unicode = if (@import("options").unicode)
@import("unicode.zig").Unicode
else
@compileError("Not compiled with unicode support");

test "other" {
comptime if (@import("options").unicode) {
_ = @import("unicode.zig");
};
}

// Matrix Filling: for two sequences a1a2a3..., b1b2b3... we have a reward
// function
//
Expand Down
254 changes: 0 additions & 254 deletions src/unicode.zig

This file was deleted.

0 comments on commit bf425e3

Please sign in to comment.