Skip to content

Commit

Permalink
add on_fetch to binutils package
Browse files Browse the repository at this point in the history
  • Loading branch information
enzalito committed Jul 12, 2024
1 parent 41fe349 commit 66a1dc7
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions packages/b/binutils/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,28 @@ package("binutils")
add_extsources("brew::binutils")
end

on_fetch("@linux", "@macosx", "@msys", function (package, opt)
if opt.system then
if package:is_binary() then
if package:find_tool("system::ld") then
return {}
end
elseif package:is_library() then
local libs = {"bfd", "ctf", "opcodes"}
links = {}
for _, lib in ipairs(libs) do
local libinfo = package:find_package("system::" .. lib)
if libinfo then
table.insert(result.links, libinfo.links)
end
end
if #links ~= 0 then
return {links = links}
end
end
end
end)

add_deps("bison")

on_install("@linux", "@macosx", "@msys", function (package)
Expand Down

0 comments on commit 66a1dc7

Please sign in to comment.