diff options
| author | ruki <[email protected]> | 2024-04-11 22:46:05 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-04-11 22:46:05 +0800 |
| commit | c660b69ea4fa30ef89c48500fb030fef5bc6da6b (patch) | |
| tree | da284cf95cfe2f21cbcf2fe3c1d2639b118ce620 /xmake/toolchains/tinycc/xmake.lua | |
| parent | 22889863c89f94fd931fc8519b1ad93506d07498 (diff) | |
improve tinycc toolchain #4962
Diffstat (limited to 'xmake/toolchains/tinycc/xmake.lua')
| -rw-r--r-- | xmake/toolchains/tinycc/xmake.lua | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/xmake/toolchains/tinycc/xmake.lua b/xmake/toolchains/tinycc/xmake.lua index 21bb7be08..6ca46172f 100644 --- a/xmake/toolchains/tinycc/xmake.lua +++ b/xmake/toolchains/tinycc/xmake.lua @@ -20,22 +20,14 @@ -- define toolchain toolchain("tinycc") - - -- set homepage + set_kind("standalone") set_homepage("https://bellard.org/tcc/") set_description("Tiny C Compiler") - -- mark as standalone toolchain - set_kind("standalone") - - -- check toolchain on_check(function (toolchain) - - -- imports import("core.project.config") import("lib.detect.find_tool") - -- find tcc local paths = {toolchain:bindir()} local sdkdir = toolchain:sdkdir() if sdkdir then @@ -55,10 +47,7 @@ toolchain("tinycc") end end) - -- on load on_load(function (toolchain) - - -- imports import("core.project.config") -- add march flags @@ -91,4 +80,15 @@ toolchain("tinycc") toolchain:add("linkdirs", path.join(installdir, "lib")) end end + local sdkdir = package:sdkdir() + if os.isdir(sdkdir) then + local includedir = path.join(sdkdir, "include") + if os.isdir(includedir) then + toolchain:add("sysincludedirs", includedir) + end + local libdir = path.join(sdkdir, "lib") + if os.isdir(libdir) then + toolchain:add("linkdirs", libdir) + end + end end) |
