Skip to content

Commit

Permalink
export Qt module
Browse files Browse the repository at this point in the history
  • Loading branch information
kassane authored Dec 2, 2023
1 parent 6e65c41 commit bedeab3
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ pub fn build(b: *std.Build) !void {
const target = b.standardTargetOptions(.{});
const mode = b.standardOptimizeOption(.{});

// Module
_ = b.addModule("Qt", .{
.source_file = .{
.path = "src/Qt.zig",
},
});

// Note: If it is not necessary to compile DOtherSide library, please comment on this line.
const cmake = cmakeBuild(b);
const cmake_step = b.step("cmake", "Run cmake build");
Expand Down Expand Up @@ -71,12 +78,7 @@ fn makeExample(b: *std.Build, src: BuildInfo) !void {
example.strip = true;
}

// Module
const Qt = b.createModule(.{
.source_file = .{ .path = "src/Qt.zig" },
});

example.addModule("Qt", Qt);
example.addModule("Qt", b.modules.get("Qt").?);
example.addLibraryPath(.{ .path = "zig-cache/lib" });

if (example.target.isWindows()) {
Expand All @@ -98,7 +100,7 @@ fn makeExample(b: *std.Build, src: BuildInfo) !void {
run_step.dependOn(&run_cmd.step);
}

fn cmakeBuild(b: *std.Build) *std.Build.Step.Run {
pub fn cmakeBuild(b: *std.Build) *std.Build.Step.Run {
const dotherside = b.dependency("dotherside", .{}).path("").getPath(b);
//CMake builds - DOtherSide build
const DOtherSide_configure = b.addSystemCommand(&[_][]const u8{
Expand Down

0 comments on commit bedeab3

Please sign in to comment.