diff options
Diffstat (limited to 'xmake/rules/objc++/xmake.lua')
| -rw-r--r-- | xmake/rules/objc++/xmake.lua | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/xmake/rules/objc++/xmake.lua b/xmake/rules/objc++/xmake.lua index 248745b86..61cb590bc 100644 --- a/xmake/rules/objc++/xmake.lua +++ b/xmake/rules/objc++/xmake.lua @@ -22,12 +22,32 @@ rule("objc.build") set_sourcekinds("mm") add_deps("c.build.pcheader") + after_load(function (target) + if target:values("objc.build.arc") ~= false then + target:add("mflags", "-fobjc-arc") + else + target:add("mflags", "-fno-objc-arc") + end + if is_plat("macosx", "iphoneos", "watchos") then + target:add("frameworks", "Foundation", "CoreFoundation") + end + end) on_build_files("private.action.build.object", {batch = true}) -- define rule: objc++.build rule("objc++.build") set_sourcekinds("mxx") add_deps("c++.build.pcheader") + after_load(function (target) + if target:values("objc++.build.arc") ~= false then + target:add("mxxflags", "-fobjc-arc") + else + target:add("mxxflags", "-fno-objc-arc") + end + if is_plat("macosx", "iphoneos", "watchos") then + target:add("frameworks", "Foundation", "CoreFoundation") + end + end) on_build_files("private.action.build.object", {batch = true}) -- define rule: objc |
