summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/xmake.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2025-12-02 16:16:13 +0800
committerGitHub <[email protected]>2025-12-02 16:16:13 +0800
commitbc7caf95a9cfdefed930937e8450997a4cdc8191 (patch)
treede6f77256d55a0f49c5889b10b3962a6406673a8 /xmake/rules/c++/xmake.lua
parentf4533a6c109732c983329d5121929b9635409a3d (diff)
parent73e234824c235191f430400f4bb7b39421ee1fb4 (diff)
Merge pull request #7088 from xmake-io/rule
Improve c++/objc rules
Diffstat (limited to 'xmake/rules/c++/xmake.lua')
-rw-r--r--xmake/rules/c++/xmake.lua24
1 files changed, 6 insertions, 18 deletions
diff --git a/xmake/rules/c++/xmake.lua b/xmake/rules/c++/xmake.lua
index e0673837d..dbb24451d 100644
--- a/xmake/rules/c++/xmake.lua
+++ b/xmake/rules/c++/xmake.lua
@@ -20,31 +20,19 @@
rule("c.build")
set_sourcekinds("cc")
- add_deps("c.build.pcheader", "c.build.optimization", "c.build.sanitizer")
- on_build_files("private.action.build.object", {jobgraph = true, batch = true, distcc = true})
+ add_deps("c.build.pcheader")
on_config(function (target)
- -- https://github.com/xmake-io/xmake/issues/4621
- if target:is_plat("windows") and target:is_static() and target:has_tool("cc", "tcc") then
- target:set("extension", ".a")
- target:set("prefixname", "lib")
- end
+ import("config")(target, "cc")
end)
+ on_build_files("private.action.build.object", {jobgraph = true, batch = true, distcc = true})
rule("c++.build")
set_sourcekinds("cxx")
- add_deps("c++.build.pcheader", "c++.build.modules", "c++.build.optimization", "c++.build.sanitizer")
- on_build_files("private.action.build.object", {jobgraph = true, batch = true, distcc = true})
+ add_deps("c++.build.pcheader", "c++.build.modules")
on_config(function (target)
- -- enable c++ exceptions by default
- if target:is_plat("windows") and not target:get("exceptions") then
- target:set("exceptions", "cxx")
- end
- -- https://github.com/xmake-io/xmake/issues/4621
- if target:is_plat("windows") and target:is_static() and target:has_tool("cxx", "tcc") then
- target:set("extension", ".a")
- target:set("prefixname", "lib")
- end
+ import("config")(target, "cxx")
end)
+ on_build_files("private.action.build.object", {jobgraph = true, batch = true, distcc = true})
rule("c")