From 0f19ea21f9c9d3f94ace3f8a836deeb63affdad7 Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 21 Aug 2024 22:50:31 +0800 Subject: add cosmocc option --- core/src/tbox/tbox | 2 +- core/xmake.lua | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/core/src/tbox/tbox b/core/src/tbox/tbox index 553c32406..57e57a327 160000 --- a/core/src/tbox/tbox +++ b/core/src/tbox/tbox @@ -1 +1 @@ -Subproject commit 553c32406a09e3e0a0a8e8dfed741b4888ba07ca +Subproject commit 57e57a3271ad925936b3fbf37877f9eceb49ee4e diff --git a/core/xmake.lua b/core/xmake.lua index 675d4676f..df84e81bb 100644 --- a/core/xmake.lua +++ b/core/xmake.lua @@ -48,6 +48,16 @@ if is_mode("coverage") then add_ldflags("-coverage", "-fprofile-arcs", "-ftest-coverage") end +-- set cosmocc toolchain, e.g. xmake f -p linux --cosmocc=y +if has_config("cosmocc") then + add_requires("cosmocc") + set_toolchains("@cosmocc") + set_policy("build.ccache", false) +end + +-- the cosmocc option +option("cosmocc", {default = false, category = "option", description = "Use cosmocc toolchain to build once and run anywhere."}) + -- the runtime option option("runtime") set_default("lua") -- cgit v1.3.1