zig/test/standalone/main_pkg_path/build.zig
Andrew Kelley 67b4de33d2
compile error for import outside package path
closes #2024

there's a new cli option `--main-pkg-path` which you can use to choose
a different root package directory besides the one inferred from the
root source file

and a corresponding build.zig API:
foo.setMainPkgPath(path)
2019-03-02 10:38:27 -05:00

10 lines
261 B
Zig

const Builder = @import("std").build.Builder;
pub fn build(b: *Builder) void {
const test_exe = b.addTest("a/test.zig");
test_exe.setMainPkgPath(".");
const test_step = b.step("test", "Test the program");
test_step.dependOn(&test_exe.step);
}