core: remove linux support
The `mach.Core` API needs major design changes, and every backend that it supports today must be updated to account for those API design changes. Unless someone is actively maintaining and improving the state of a given backend, it slows down our ability to make those critical changes. Unfortunately, the backends for X11 and Wayland today are half-baked, nobody is actively maintaining on or contributing to them, and the Linux CI tests have been broken for over a month as a result which harms overall stability of Mach. As a result, this PR removes Linux support from `mach.Core` Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
51e996db72
commit
17450fde65
5 changed files with 4 additions and 2237 deletions
45
build.zig
45
build.zig
|
|
@ -102,46 +102,11 @@ pub fn build(b: *std.Build) !void {
|
||||||
if (want_examples) try buildExamples(b, optimize, target, module);
|
if (want_examples) try buildExamples(b, optimize, target, module);
|
||||||
}
|
}
|
||||||
if (want_core) {
|
if (want_core) {
|
||||||
if (target.result.cpu.arch != .wasm32) {
|
if (target.result.isDarwin()) {
|
||||||
// TODO: for some reason this is not functional, a Zig bug (only when using this Zig package
|
if (b.lazyDependency("mach_objc", .{
|
||||||
// externally):
|
|
||||||
//
|
|
||||||
// module.addCSourceFile(.{ .file = b.path("src/core/platform/wayland/wayland.c" });
|
|
||||||
//
|
|
||||||
// error: unable to check cache: stat file '/Volumes/data/hexops/mach-core-starter-project/zig-cache//Volumes/data/hexops/mach-core-starter-project/src/core/platform/wayland/wayland.c' failed: FileNotFound
|
|
||||||
//
|
|
||||||
// So instead we do this:
|
|
||||||
const lib = b.addStaticLibrary(.{
|
|
||||||
.name = "core-wayland",
|
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
});
|
})) |dep| module.addImport("objc", dep.module("mach-objc"));
|
||||||
lib.addCSourceFile(.{
|
|
||||||
.file = b.path("src/core/wayland/wayland.c"),
|
|
||||||
});
|
|
||||||
lib.linkLibC();
|
|
||||||
module.linkLibrary(lib);
|
|
||||||
|
|
||||||
if (b.lazyDependency("x11_headers", .{
|
|
||||||
.target = target,
|
|
||||||
.optimize = optimize,
|
|
||||||
})) |dep| {
|
|
||||||
module.linkLibrary(dep.artifact("x11-headers"));
|
|
||||||
lib.linkLibrary(dep.artifact("x11-headers"));
|
|
||||||
}
|
|
||||||
if (b.lazyDependency("wayland_headers", .{
|
|
||||||
.target = target,
|
|
||||||
.optimize = optimize,
|
|
||||||
})) |dep| {
|
|
||||||
module.linkLibrary(dep.artifact("wayland-headers"));
|
|
||||||
lib.linkLibrary(dep.artifact("wayland-headers"));
|
|
||||||
}
|
|
||||||
if (target.result.isDarwin()) {
|
|
||||||
if (b.lazyDependency("mach_objc", .{
|
|
||||||
.target = target,
|
|
||||||
.optimize = optimize,
|
|
||||||
})) |dep| module.addImport("objc", dep.module("mach-objc"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (want_sysaudio) {
|
if (want_sysaudio) {
|
||||||
|
|
@ -284,8 +249,6 @@ pub fn build(b: *std.Build) !void {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const Platform = enum {
|
pub const Platform = enum {
|
||||||
x11,
|
|
||||||
wayland,
|
|
||||||
wasm,
|
wasm,
|
||||||
win32,
|
win32,
|
||||||
darwin,
|
darwin,
|
||||||
|
|
@ -295,7 +258,7 @@ pub const Platform = enum {
|
||||||
if (target.cpu.arch == .wasm32) return .wasm;
|
if (target.cpu.arch == .wasm32) return .wasm;
|
||||||
if (target.os.tag.isDarwin()) return .darwin;
|
if (target.os.tag.isDarwin()) return .darwin;
|
||||||
if (target.os.tag == .windows) return .win32;
|
if (target.os.tag == .windows) return .win32;
|
||||||
return .x11;
|
return .null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,6 @@ pub const Timer = @import("core/Timer.zig");
|
||||||
const Frequency = @import("core/Frequency.zig");
|
const Frequency = @import("core/Frequency.zig");
|
||||||
|
|
||||||
pub const Platform = switch (build_options.core_platform) {
|
pub const Platform = switch (build_options.core_platform) {
|
||||||
.x11 => @import("core/X11.zig"),
|
|
||||||
.wayland => @import("core/Wayland.zig"),
|
|
||||||
.wasm => @panic("TODO: support mach.Core WASM platform"),
|
.wasm => @panic("TODO: support mach.Core WASM platform"),
|
||||||
.win32 => @import("core/win32.zig"),
|
.win32 => @import("core/win32.zig"),
|
||||||
.darwin => @import("core/Darwin.zig"),
|
.darwin => @import("core/Darwin.zig"),
|
||||||
|
|
@ -25,8 +23,6 @@ pub const Platform = switch (build_options.core_platform) {
|
||||||
// platform must take control and drive the main loop itself.
|
// platform must take control and drive the main loop itself.
|
||||||
pub const supports_non_blocking = switch (build_options.core_platform) {
|
pub const supports_non_blocking = switch (build_options.core_platform) {
|
||||||
.win32 => true,
|
.win32 => true,
|
||||||
.x11 => true,
|
|
||||||
.wayland => true,
|
|
||||||
.wasm => false,
|
.wasm => false,
|
||||||
.darwin => false,
|
.darwin => false,
|
||||||
.null => false,
|
.null => false,
|
||||||
|
|
|
||||||
1024
src/core/Wayland.zig
1024
src/core/Wayland.zig
File diff suppressed because it is too large
Load diff
1161
src/core/X11.zig
1161
src/core/X11.zig
File diff suppressed because it is too large
Load diff
|
|
@ -1,7 +0,0 @@
|
||||||
#include "wayland-client-protocol-code.h"
|
|
||||||
#include "wayland-xdg-shell-client-protocol-code.h"
|
|
||||||
#include "wayland-xdg-decoration-client-protocol-code.h"
|
|
||||||
#include "wayland-viewporter-client-protocol-code.h"
|
|
||||||
#include "wayland-relative-pointer-unstable-v1-client-protocol-code.h"
|
|
||||||
#include "wayland-pointer-constraints-unstable-v1-client-protocol-code.h"
|
|
||||||
#include "wayland-idle-inhibit-unstable-v1-client-protocol-code.h"
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue