Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix custom rules not applying under the utility project kind on gmake2 #1939

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion modules/gmake2/gmake2_utility.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,25 @@


function utility.initialize(prj)
local rules = {}

local function addRule(extension, rule)
if type(extension) == 'table' then
for _, value in ipairs(extension) do
addRule(value, rule)
end
else
rules[extension] = rule
end
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can similar/copied code from gmake2_cpp.lua be factorized?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest, it should be. But i dont know the right place for it to be.


for _, name in ipairs(prj.rules) do
local rule = p.global.getRule(name)
addRule(rule.fileExtension, rule)
end

prj._gmake = prj._gmake or {}
prj._gmake.rules = prj.rules
prj._gmake.rules = rules
prj._gmake.filesets = { }
end

Expand Down