summaryrefslogtreecommitdiff
path: root/xmake/rules/xcode
diff options
context:
space:
mode:
authorruki <[email protected]>2022-09-20 00:29:05 +0800
committerruki <[email protected]>2022-09-20 00:29:05 +0800
commitc8dc37772dbd9250297d59778dd45c99e25c70a3 (patch)
treef3e987779c623748bac27603c2d8bbdbcd7e02bf /xmake/rules/xcode
parent1060233e0c71738ce6a010a395773fe68b0d057e (diff)
fix install bundle
Diffstat (limited to 'xmake/rules/xcode')
-rw-r--r--xmake/rules/xcode/bundle/xmake.lua23
1 files changed, 11 insertions, 12 deletions
diff --git a/xmake/rules/xcode/bundle/xmake.lua b/xmake/rules/xcode/bundle/xmake.lua
index b78e115ed..9713e3b09 100644
--- a/xmake/rules/xcode/bundle/xmake.lua
+++ b/xmake/rules/xcode/bundle/xmake.lua
@@ -27,15 +27,6 @@ rule("xcode.bundle")
-- we must set kind before target.on_load(), may we will use target in on_load()
on_load(function (target)
- -- generate binary as bundle, we cannot set `-shared` or `-dynamiclib`
- target:set("kind", "binary")
-
- -- set target info for bundle
- target:set("filename", target:basename())
- end)
-
- on_config(function (target)
-
-- get bundle directory
local targetdir = target:targetdir()
local bundledir = path.join(targetdir, target:basename() .. ".bundle")
@@ -51,6 +42,17 @@ rule("xcode.bundle")
target:data_set("xcode.bundle.contentsdir", contentsdir)
target:data_set("xcode.bundle.resourcesdir", resourcesdir)
+ -- register clean files for `xmake clean`
+ target:add("cleanfiles", bundledir)
+
+ -- generate binary as bundle, we cannot set `-shared` or `-dynamiclib`
+ target:set("kind", "binary")
+
+ -- set target info for bundle
+ target:set("filename", target:basename())
+ end)
+
+ on_config(function (target)
-- add bundle flags
local linker = target:linker():name()
if linker == "swiftc" then
@@ -58,9 +60,6 @@ rule("xcode.bundle")
else
target:add("ldflags", "-bundle", {force = true})
end
-
- -- register clean files for `xmake clean`
- target:add("cleanfiles", bundledir)
end)
after_build(function (target, opt)