From db9500fd626062cf5096aec42ae5d24f6b910a22 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 19 Jan 2024 22:33:06 +0800 Subject: improve tcc link --- xmake/rules/c++/xmake.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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++") -- cgit v1.3.1 From d6b735946decd66fe980899e65f8cbaf187d2ea5 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 19 Jan 2024 22:33:48 +0800 Subject: fix typo --- xmake/rules/c++/xmake.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmake/rules/c++/xmake.lua b/xmake/rules/c++/xmake.lua index b6e016645..1a059c160 100644 --- a/xmake/rules/c++/xmake.lua +++ b/xmake/rules/c++/xmake.lua @@ -28,7 +28,7 @@ rule("c.build") target:set("extensions", ".a") target:set("prefixname", "lib") end - end + end) rule("c++.build") set_sourcekinds("cxx") -- cgit v1.3.1 From 1cc76ae4ad9527a7e937f79e977be9c4a11ff6dc Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 19 Jan 2024 23:42:42 +0800 Subject: fix extension --- xmake/rules/c++/xmake.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xmake/rules/c++/xmake.lua b/xmake/rules/c++/xmake.lua index 1a059c160..80d2e1417 100644 --- a/xmake/rules/c++/xmake.lua +++ b/xmake/rules/c++/xmake.lua @@ -25,7 +25,7 @@ rule("c.build") 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("extension", ".a") target:set("prefixname", "lib") end end) @@ -37,11 +37,11 @@ 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("extensions", ".a") + target:set("extension", ".a") target:set("prefixname", "lib") end end) -- cgit v1.3.1