summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/xmake.lua
diff options
context:
space:
mode:
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..23e5f27bc 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("rules.c++.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("rules.c++.config")(target, "cxx")
end)
+ on_build_files("private.action.build.object", {jobgraph = true, batch = true, distcc = true})
rule("c")