summaryrefslogtreecommitdiff
path: root/xmake/core/project/target.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/core/project/target.lua')
-rw-r--r--xmake/core/project/target.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua
index 51eef59b9..e91f09408 100644
--- a/xmake/core/project/target.lua
+++ b/xmake/core/project/target.lua
@@ -979,8 +979,14 @@ function _instance:sourcefiles()
deleted = true
end
- -- match source files
- local results = os.match(file)
+ -- find source files
+ local results = os.files(file)
+ if #results == 0 then
+ -- attempt to find source directories if maybe compile it as directory with the custom rules
+ if #self:filerules(file) > 0 then
+ results = os.dirs(file)
+ end
+ end
if #results == 0 then
local sourceinfo = (self:get("__sourceinfo_files") or {})[file] or {}
utils.warning("cannot match %s(%s).%s_files(\"%s\") at %s:%d", self:type(), self:name(), utils.ifelse(deleted, "del", "add"), file, sourceinfo.file or "", sourceinfo.line or -1)