mirror of
https://github.com/sbrow/envr.git
synced 2026-06-27 18:48:33 -04:00
refactor: Broke comma into a separate package.
This commit is contained in:
@@ -21,6 +21,11 @@ pub fn build(b: *std.Build) void {
|
||||
// target and optimize options) will be listed when running `zig build --help`
|
||||
// in this directory.
|
||||
|
||||
const comma = b.addModule("comma", .{
|
||||
.root_source_file = b.path("src/comma.zig"),
|
||||
.target = target,
|
||||
});
|
||||
|
||||
// This creates a module, which represents a collection of source files alongside
|
||||
// some compilation options, such as optimization mode and linked system libraries.
|
||||
// Zig modules are the preferred way of making Zig code available to consumers.
|
||||
@@ -39,6 +44,9 @@ pub fn build(b: *std.Build) void {
|
||||
// Later on we'll use this module as the root module of a test executable
|
||||
// which requires us to specify a target.
|
||||
.target = target,
|
||||
.imports = &.{
|
||||
.{ .name = "comma", .module = comma },
|
||||
},
|
||||
});
|
||||
|
||||
// Here we define an executable. An executable needs to have a root module
|
||||
@@ -78,6 +86,7 @@ pub fn build(b: *std.Build) void {
|
||||
// repeated because you are allowed to rename your imports, which
|
||||
// can be extremely useful in case of collisions (which can happen
|
||||
// importing modules from different packages).
|
||||
.{ .name = "comma", .module = comma },
|
||||
.{ .name = "envr", .module = mod },
|
||||
},
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user