diff options
| author | ruki <[email protected]> | 2022-09-27 22:44:26 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-09-27 22:44:26 +0800 |
| commit | 7d45ffda6d19cd057a445b1a20ad37e8b9094cb5 (patch) | |
| tree | e9e71ae9e7faa375b526d31c3c02d887c2d64589 | |
| parent | 25e9a13d183e4639e258d31b73e4281b1242081f (diff) | |
improve load rules for target
| -rw-r--r-- | xmake/core/project/project.lua | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/xmake/core/project/project.lua b/xmake/core/project/project.lua index 989dc0302..d0f0145df 100644 --- a/xmake/core/project/project.lua +++ b/xmake/core/project/project.lua @@ -350,16 +350,7 @@ function project._load_targets() for _, t in pairs(targets) do -- load rules from target and language - -- - -- e.g. - -- - -- a.deps = b - -- b.deps = c - -- - -- orderules: c -> b -> a - -- - t._RULES = t._RULES or {} - t._ORDERULES = t._ORDERULES or {} + t._RULES = t._RULES or {} local rulenames = {} local extensions = {} table.join2(rulenames, t:get("rules")) @@ -381,13 +372,8 @@ function project._load_targets() if r:kind() == "target" then t._RULES[rulename] = r for _, deprule in ipairs(r:orderdeps()) do - local name = deprule:name() - if not t._RULES[name] then - t._RULES[name] = deprule - table.insert(t._ORDERULES, deprule) - end + t._RULES[deprule:name()] = deprule end - table.insert(t._ORDERULES, r) end else return nil, nil, string.format("unknown rule(%s) in target(%s)!", rulename, t:name()) |
