Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ x64/
*.log
*.pdb
*.py
*.tlog
*.tlog
.zig-cache/
zig-out/
52 changes: 52 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
const std = @import("std");

pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});

const exe_mod = b.createModule(.{
.target = target,
.optimize = optimize,
});

const exe = b.addExecutable(.{
.name = "Beryl",
.root_module = exe_mod,
});

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

exe.addCSourceFiles(.{
.root = b.path(""),
.files = &.{
"cmdLine.cpp",
"globals.cpp",
"main.cpp",
"permutation.cpp",
"solver.cpp",
"symmetry.cpp",
"util.cpp",
},
.flags = &.{"-std=c++17"},
});

exe.addIncludePath(eigen.path(""));

exe.linkLibCpp();

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);
}
37 changes: 37 additions & 0 deletions build.zig.zon
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
.{
.name = .Beryl,

.version = "0.0.0",

.fingerprint = 0x565a8f7bc37099d, // Changing this has security and trust implications.

.minimum_zig_version = "0.14.0",

.dependencies = .{
.Eigen = .{
.url = "https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz",
.hash = "N-V-__8AABPI6wAbBLaww8cKO-HchZ0ft-BxUOEOyQtTSccD",
},
},
.paths = .{
"build.zig",
"build.zig.zon",
"cmdLine.cpp",
"cmdLine.h",
"globals.cpp",
"globals.h",
"LICENSE",
"main.cpp",
"permutation.cpp",
"permutation.h",
"plane.h",
"README.md",
"solver.cpp",
"solver.h",
"symmetry.cpp",
"symmetry.h",
"types.h",
"util.cpp",
"util.h",
},
}