mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-10-15 22:36:14 +00:00
add app runtime option, add gtk backend
This commit is contained in:
12
src/main.zig
12
src/main.zig
@@ -1,5 +1,6 @@
|
||||
const std = @import("std");
|
||||
const builtin = @import("builtin");
|
||||
const build_config = @import("build_config.zig");
|
||||
const options = @import("build_options");
|
||||
const glfw = @import("glfw");
|
||||
const macos = @import("macos");
|
||||
@@ -88,12 +89,19 @@ pub fn main() !void {
|
||||
try config.finalize();
|
||||
std.log.debug("config={}", .{config});
|
||||
|
||||
// We want to log all our errors
|
||||
glfw.setErrorCallback(glfwErrorCallback);
|
||||
switch (build_config.app_runtime) {
|
||||
.none => {},
|
||||
.glfw => {
|
||||
// We want to log all our errors
|
||||
glfw.setErrorCallback(glfwErrorCallback);
|
||||
},
|
||||
.gtk => {},
|
||||
}
|
||||
|
||||
// Run our app with a single initial window to start.
|
||||
var app = try App.create(alloc, .{}, &config);
|
||||
defer app.destroy();
|
||||
if (build_config.app_runtime == .gtk) return;
|
||||
_ = try app.newWindow(.{});
|
||||
try app.run();
|
||||
}
|
||||
|
Reference in New Issue
Block a user