Skip to content

Commit

Permalink
refactor(rules/iverilog): Use target:get_from to get defines
Browse files Browse the repository at this point in the history
  • Loading branch information
24bit-xjkp committed Sep 30, 2024
1 parent 6f209ca commit 8482d2e
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions xmake/rules/iverilog/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,8 @@ rule("iverilog.binary")
end

-- get defines
local add_defines = function(defines)
for _, define in ipairs(defines or {}) do
table.insert(argv, "-D" .. define)
end
end
add_defines(target:get("defines"))
-- support add_defines in options
for _, option_name in ipairs(target:get("options") or {}) do
local option = project.option(option_name)
add_defines(option:enabled() and option:get("defines"))
for _, define in ipairs(target:get_from("defines", "*") or {}) do
table.insert(argv, "-D" .. define)
end

-- get includedirs
Expand Down

0 comments on commit 8482d2e

Please sign in to comment.