summaryrefslogtreecommitdiff
path: root/xmake/core/project/target.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2021-03-09 00:45:15 +0800
committerruki <[email protected]>2021-03-09 00:45:15 +0800
commitd2bf2df2c3afdf1335721ae37cfeb721ff130227 (patch)
tree5ab9417065ef1b3f90bf32d488f463f5fb66483b /xmake/core/project/target.lua
parent297eac57c0369f473751a88e0b74f7857e74e462 (diff)
improve rules
Diffstat (limited to 'xmake/core/project/target.lua')
-rw-r--r--xmake/core/project/target.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua
index 079199b47..ee7e3f519 100644
--- a/xmake/core/project/target.lua
+++ b/xmake/core/project/target.lua
@@ -1105,7 +1105,10 @@ function _instance:filerules(sourcefile)
end
-- get target rules from the given sourcekind or extension
- for _, r in ipairs(table.wrap(key2rules[self:sourcekind_of(sourcefile)] or key2rules[path.extension(sourcefile):lower()])) do
+ local filename = path.filename(sourcefile):lower()
+ for _, r in ipairs(table.wrap(key2rules[path.extension(filename, 2)] or
+ key2rules[path.extension(filename)] or
+ key2rules[self:sourcekind_of(filename)])) do
table.insert(rules, r)
end
return rules