diff options
| -rw-r--r-- | xmake/rules/c++/xmake.lua | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/xmake/rules/c++/xmake.lua b/xmake/rules/c++/xmake.lua index e130df73b..80d2e1417 100644 --- a/xmake/rules/c++/xmake.lua +++ b/xmake/rules/c++/xmake.lua @@ -22,6 +22,13 @@ rule("c.build") set_sourcekinds("cc") add_deps("c.build.pcheader", "c.build.optimization", "c.build.sanitizer") on_build_files("private.action.build.object", {batch = true, distcc = true}) + 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 + end) rule("c++.build") set_sourcekinds("cxx") @@ -30,7 +37,12 @@ rule("c++.build") on_config(function (target) -- we enable c++ exceptions by default if target:is_plat("windows") and not target:get("exceptions") then - target:set("exceptions", "cxx") + target:set("exception", "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 end) |
