summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-01-19 21:05:37 +0800
committerGitHub <[email protected]>2024-01-19 21:05:37 +0800
commit33cde167c8f85a8be7797c566e800a57fd375967 (patch)
tree9a00e2bab04444536ad2dad5aa0cabc26e4fa803
parent2d4bbc3ae4171a4853f534a9a9d299a1fd05fcf1 (diff)
parent1cc76ae4ad9527a7e937f79e977be9c4a11ff6dc (diff)
Merge pull request #4626 from xmake-io/tcc
improve tcc link
-rw-r--r--xmake/rules/c++/xmake.lua14
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)