From fec57196a1a0a67f3392635fee5a2b3ec9f7be08 Mon Sep 17 00:00:00 2001 From: ruki Date: Mon, 22 Aug 2022 22:44:20 +0800 Subject: use uikit for catalyst and fix ibtool --- xmake/rules/xcode/application/load.lua | 7 ++++++- xmake/rules/xcode/storyboard/xmake.lua | 12 ++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/xmake/rules/xcode/application/load.lua b/xmake/rules/xcode/application/load.lua index 354aa5b0c..8be4077a3 100644 --- a/xmake/rules/xcode/application/load.lua +++ b/xmake/rules/xcode/application/load.lua @@ -47,7 +47,12 @@ function main (target) -- add frameworks if target:is_plat("macosx") then - target:add("frameworks", "AppKit") + local xcode = target:toolchain("xcode") + if xcode and xcode:config("appledev") == "catalyst" then + target:add("frameworks", "UIKit") + else + target:add("frameworks", "AppKit") + end else target:add("frameworks", "UIKit") end diff --git a/xmake/rules/xcode/storyboard/xmake.lua b/xmake/rules/xcode/storyboard/xmake.lua index d96a1c002..3db9db4c3 100644 --- a/xmake/rules/xcode/storyboard/xmake.lua +++ b/xmake/rules/xcode/storyboard/xmake.lua @@ -65,8 +65,16 @@ rule("xcode.storyboard") end local argv = {"--errors", "--warnings", "--notices", "--auto-activate-custom-fonts", "--output-format", "human-readable-text"} if target:is_plat("macosx") then - table.insert(argv, "--target-device") - table.insert(argv, "mac") + local xcode = target:toolchain("xcode") + if xcode and xcode:config("appledev") == "catalyst" then + table.insert(argv, "--platform") + table.insert(argv, "macosx") + table.insert(argv, "--target-device") + table.insert(argv, "ipad") + else + table.insert(argv, "--target-device") + table.insert(argv, "mac") + end elseif target:is_plat("iphoneos") then table.insert(argv, "--target-device") table.insert(argv, "iphone") -- cgit v1.3.1