prime31 / zig-ecs

MIT License
230 stars 36 forks source link

Use `addModule` instead of `createModule` for package visibility #30

Closed GeezerLMAO closed 1 year ago

GeezerLMAO commented 1 year ago

According to the zig documentation the difference is that addModule() creates a module and adds it to the package's module set, making it available to other packages which depend on this one. createModule() can be used instead to create a private module.

Using addModule enables us to use zig-ecs in build.zig.zon

build.zig.zon:

.{
    .name = "Foo",
    .version = "0.0.1",
    .dependencies = .{
        .zig_ecs = .{
            .url = "https://github.com/prime31/zig-ecs/archive/20e83efc681f85f6468ac6fdcb905ed28058288b.tar.gz",
            .hash = "12203176d35de3d948b68536f17c2aa16c7567a5dc91a67b69361b93633732b4f626",
        }
    }
}

build.zig:

exe.addModule("ecs", b.dependency("zig_ecs", .{}).module("zig-ecs"));