Skip to content

Commit

Permalink
improve tinycc toolchain #4962
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Apr 11, 2024
1 parent 2288986 commit c660b69
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions xmake/toolchains/tinycc/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -55,10 +47,7 @@ toolchain("tinycc")
end
end)

-- on load
on_load(function (toolchain)

-- imports
import("core.project.config")

-- add march flags
Expand Down Expand Up @@ -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)

0 comments on commit c660b69

Please sign in to comment.