diff --git a/src/build/GhosttyXCFramework.zig b/src/build/GhosttyXCFramework.zig index 3afeb9073..a19dd18af 100644 --- a/src/build/GhosttyXCFramework.zig +++ b/src/build/GhosttyXCFramework.zig @@ -53,6 +53,16 @@ pub fn init( }), )); + // Generate a headers directory with only ghostty.h and the module + // map. We can't use include/ directly because it also contains the + // libghostty-vt headers under include/ghostty/, which would trigger + // "umbrella header does not include header" warnings from Clang's + // module system. + const wf = b.addWriteFiles(); + _ = wf.addCopyFile(b.path("include/ghostty.h"), "ghostty.h"); + _ = wf.addCopyFile(b.path("include/module.modulemap"), "module.modulemap"); + const headers = wf.getDirectory(); + // The xcframework wraps our ghostty library so that we can link // it to the final app built with Swift. const xcframework = XCFrameworkStep.create(b, .{ @@ -62,24 +72,24 @@ pub fn init( .universal => &.{ .{ .library = macos_universal.output, - .headers = b.path("include"), + .headers = headers, .dsym = macos_universal.dsym, }, .{ .library = ios.output, - .headers = b.path("include"), + .headers = headers, .dsym = ios.dsym, }, .{ .library = ios_sim.output, - .headers = b.path("include"), + .headers = headers, .dsym = ios_sim.dsym, }, }, .native => &.{.{ .library = macos_native.output, - .headers = b.path("include"), + .headers = headers, .dsym = macos_native.dsym, }}, },