aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.zig35
-rw-r--r--src/river.zig (renamed from src/main.zig)0
-rw-r--r--src/riverctl.zig26
3 files changed, 46 insertions, 15 deletions
diff --git a/build.zig b/build.zig
index d57a142..2e66934 100644
--- a/build.zig
+++ b/build.zig
@@ -19,30 +19,35 @@ pub fn build(b: *std.build.Builder) !void {
const scan_protocols = ScanProtocolsStep.create(b);
- const exe = b.addExecutable("river", "src/main.zig");
- exe.setTarget(target);
- exe.setBuildMode(mode);
- exe.addBuildOption(bool, "xwayland", xwayland);
- addDeps(exe, &scan_protocols.step);
- exe.install();
-
- const run_cmd = exe.run();
+ const river = b.addExecutable("river", "src/river.zig");
+ river.setTarget(target);
+ river.setBuildMode(mode);
+ river.addBuildOption(bool, "xwayland", xwayland);
+ addServerDeps(river, &scan_protocols.step);
+ river.install();
+
+ const run_cmd = river.run();
run_cmd.step.dependOn(b.getInstallStep());
const run_step = b.step("run", "Run the compositor");
run_step.dependOn(&run_cmd.step);
- const test_exe = b.addTest("src/test_main.zig");
- test_exe.setTarget(target);
- test_exe.setBuildMode(mode);
- test_exe.addBuildOption(bool, "xwayland", xwayland);
- addDeps(test_exe, &scan_protocols.step);
+ const riverctl = b.addExecutable("riverctl", "src/riverctl.zig");
+ riverctl.setTarget(target);
+ riverctl.setBuildMode(mode);
+ riverctl.install();
+
+ const river_test = b.addTest("src/test_main.zig");
+ river_test.setTarget(target);
+ river_test.setBuildMode(mode);
+ river_test.addBuildOption(bool, "xwayland", xwayland);
+ addServerDeps(river_test, &scan_protocols.step);
const test_step = b.step("test", "Run the tests");
- test_step.dependOn(&test_exe.step);
+ test_step.dependOn(&river_test.step);
}
-fn addDeps(exe: *std.build.LibExeObjStep, protocol_step: *std.build.Step) void {
+fn addServerDeps(exe: *std.build.LibExeObjStep, protocol_step: *std.build.Step) void {
exe.step.dependOn(protocol_step);
exe.addIncludeDir("protocol");
exe.addCSourceFile("protocol/river-window-management-unstable-v1-protocol.c", &[_][]const u8{"-std=c99"});
diff --git a/src/main.zig b/src/river.zig
index a5f5334..a5f5334 100644
--- a/src/main.zig
+++ b/src/river.zig
diff --git a/src/riverctl.zig b/src/riverctl.zig
new file mode 100644
index 0000000..b26bcb7
--- /dev/null
+++ b/src/riverctl.zig
@@ -0,0 +1,26 @@
+// This file is part of river, a dynamic tiling wayland compositor.
+//
+// Copyright 2020 Isaac Freund
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+const std = @import("std");
+
+const c = @cImport({
+ @cInclude();
+});
+
+pub fn main() void {
+ std.debug.warn("hello world\n", .{});
+}