summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2021-09-03 22:49:25 +0800
committerruki <[email protected]>2021-09-03 22:49:25 +0800
commit5081081d6c1ca1a7198ac646adc755efb49b6b38 (patch)
tree873eb69d58a3e55bd81be47708192e2a24202f5c
parent91a2ebc3edf46a26c00807953e3a22d716bdeb95 (diff)
fix add_files
-rw-r--r--xmake/core/project/target.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua
index ac9b63a0c..0ff4222fa 100644
--- a/xmake/core/project/target.lua
+++ b/xmake/core/project/target.lua
@@ -1167,22 +1167,22 @@ function _instance:fileconfig(sourcefile)
-- match source files
local results = os.match(filepath)
- if #results == 0 then
+ if #results == 0 and not fileconfig.always_added then
local sourceinfo = (self:get("__sourceinfo_files") or {})[filepath] or {}
utils.warning("cannot match %s(%s).add_files(\"%s\") at %s:%d", self:type(), self:name(), filepath, sourceinfo.file or "", sourceinfo.line or -1)
end
-- process source files
for _, file in ipairs(results) do
-
- -- convert to the relative path
if path.is_absolute(file) then
file = path.relative(file, os.projectdir())
end
-
- -- save it
filesconfig[file] = fileconfig
end
+ -- we also need support always_added, @see https://github.com/xmake-io/xmake/issues/1634
+ if #results == 0 and fileconfig.always_added then
+ filesconfig[filepath] = fileconfig
+ end
end
self._FILESCONFIG = filesconfig
end