use target OS, not host, to trigger build differences

This commit is contained in:
Emil Lerch 2021-11-09 10:43:25 -08:00
parent 9c41e1228d
commit 12c604272d
Signed by: lobo
GPG Key ID: A7B62D657EF764F8

View File

@ -14,7 +14,7 @@ pub fn build(b: *std.build.Builder) void {
const exe = b.addExecutable("clipboard", "src/main.zig"); const exe = b.addExecutable("clipboard", "src/main.zig");
exe.setTarget(target); exe.setTarget(target);
exe.setBuildMode(mode); exe.setBuildMode(mode);
if (std.builtin.os.tag == .linux) { if (target.getOs().tag == .linux) {
// LibX11 1.7.2: https://gitlab.freedesktop.org/xorg/lib/libx11/-/archive/libX11-1.7.2/libx11-libX11-1.7.2.tar.gz // LibX11 1.7.2: https://gitlab.freedesktop.org/xorg/lib/libx11/-/archive/libX11-1.7.2/libx11-libX11-1.7.2.tar.gz
// LibXfixes 5.0.3: https://gitlab.freedesktop.org/xorg/lib/libxfixes/-/archive/libXfixes-5.0.3/libxfixes-libXfixes-5.0.3.tar.gz // LibXfixes 5.0.3: https://gitlab.freedesktop.org/xorg/lib/libxfixes/-/archive/libXfixes-5.0.3/libxfixes-libXfixes-5.0.3.tar.gz
// XOrg Proto: https://gitlab.freedesktop.org/xorg/proto/xorgproto/-/archive/xorgproto-2021.5/xorgproto-xorgproto-2021.5.tar.gz // XOrg Proto: https://gitlab.freedesktop.org/xorg/proto/xorgproto/-/archive/xorgproto-2021.5/xorgproto-xorgproto-2021.5.tar.gz
@ -37,7 +37,7 @@ pub fn build(b: *std.build.Builder) void {
inline for (dependent_objects) |obj| inline for (dependent_objects) |obj|
exe.addObjectFile(obj); exe.addObjectFile(obj);
} }
if (std.builtin.os.tag == .windows) { if (target.getOs().tag == .windows) {
// exe.linkLibC(); // exe.linkLibC();
// exe.addIncludeDir("/usr/include/"); // exe.addIncludeDir("/usr/include/");
// exe.linkSystemLibrary("X11"); // exe.linkSystemLibrary("X11");