diff options
| author | ruki <[email protected]> | 2025-12-02 22:49:56 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-12-02 22:49:56 +0800 |
| commit | 5c4b98ecca5a0c437a1bb5679e4046f752ed1a42 (patch) | |
| tree | 1e877302612037e625928a2238f5711e05b952ea /xmake/rules/objc++/xmake.lua | |
| parent | 92b61ab2648cc37da47874a4bab4d487a9a01202 (diff) | |
improve c++/objc++ rules
Diffstat (limited to 'xmake/rules/objc++/xmake.lua')
| -rw-r--r-- | xmake/rules/objc++/xmake.lua | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/xmake/rules/objc++/xmake.lua b/xmake/rules/objc++/xmake.lua index fe857deef..2ff0ecb8c 100644 --- a/xmake/rules/objc++/xmake.lua +++ b/xmake/rules/objc++/xmake.lua @@ -21,30 +21,20 @@ -- define rule: objc.build rule("objc.build") set_sourcekinds("mm") - add_deps("objc.build.pcheader", "c.build.optimization", "objc.build.sanitizer") - after_load(function (target) - -- deprecated, we only need to 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 target:is_plat("macosx", "iphoneos", "watchos") then - target:add("frameworks", "Foundation", "CoreFoundation") - end + add_deps("objc.build.pcheader") + on_config(function (target) + -- handle all configs + import("rules.objc++.config")(target, "mm") end) on_build_files("private.action.build.object", {jobgraph = true, batch = true, distcc = true}) -- define rule: objc++.build rule("objc++.build") set_sourcekinds("mxx") - add_deps("objc++.build.pcheader", "c++.build.optimization", "objc++.build.sanitizer") - after_load(function (target) - -- deprecated, we only need to 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 target:is_plat("macosx", "iphoneos", "watchos") then - target:add("frameworks", "Foundation", "CoreFoundation") - end + add_deps("objc++.build.pcheader") + on_config(function (target) + -- handle all configs + import("rules.objc++.config")(target, "mxx") end) on_build_files("private.action.build.object", {jobgraph = true, batch = true, distcc = true}) |
