diff options
| author | ruki <[email protected]> | 2021-06-07 22:43:54 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-06-07 22:43:54 +0800 |
| commit | ac05ff1b22addf25aaf846e342239674fe5c05fe (patch) | |
| tree | e4771c32f7a4786394380ef80d31f53ae6b6a7bd /xmake/rules/objc++/xmake.lua | |
| parent | 8240d2513e641ceec83b957cae42fac90ad0e306 (diff) | |
improve arc for xcode/objc
Diffstat (limited to 'xmake/rules/objc++/xmake.lua')
| -rw-r--r-- | xmake/rules/objc++/xmake.lua | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/xmake/rules/objc++/xmake.lua b/xmake/rules/objc++/xmake.lua index 72f7c3609..0107690e7 100644 --- a/xmake/rules/objc++/xmake.lua +++ b/xmake/rules/objc++/xmake.lua @@ -23,12 +23,11 @@ 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 + -- deprecated, we need only use `add_mflags("-fno-objc-arc")` to override it + if target:values("objc.build.arc") == false then target:add("mflags", "-fno-objc-arc") end - if is_plat("macosx", "iphoneos", "watchos") then + if target:is_plat("macosx", "iphoneos", "watchos") then target:add("frameworks", "Foundation", "CoreFoundation") end end) @@ -39,12 +38,11 @@ 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 + -- deprecated, we need only use `add_mxxflags("-fno-objc-arc")` to override it + if target:values("objc++.build.arc") == false then target:add("mxxflags", "-fno-objc-arc") end - if is_plat("macosx", "iphoneos", "watchos") then + if target:is_plat("macosx", "iphoneos", "watchos") then target:add("frameworks", "Foundation", "CoreFoundation") end end) |
