diff options
| author | ruki <[email protected]> | 2024-01-19 22:33:06 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-01-19 22:33:06 +0800 |
| commit | db9500fd626062cf5096aec42ae5d24f6b910a22 (patch) | |
| tree | 60d8d9e64899f29efa07480591a753c1bbe5a08a | |
| parent | 0e2e3de9ff82b8bdda7b1b72d039766cf4d4f2d6 (diff) | |
improve tcc link
| -rw-r--r-- | xmake/rules/c++/xmake.lua | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/xmake/rules/c++/xmake.lua b/xmake/rules/c++/xmake.lua index e130df73b..b6e016645 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("extensions", ".a") + target:set("prefixname", "lib") + end + end rule("c++.build") set_sourcekinds("cxx") @@ -32,6 +39,11 @@ rule("c++.build") 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("extensions", ".a") + target:set("prefixname", "lib") + end end) rule("c++") |
