diff options
| author | ruki <[email protected]> | 2022-08-10 00:54:48 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-08-10 00:54:48 +0800 |
| commit | f550fa3c35f412fd0cba433610d9e747f7d4be3f (patch) | |
| tree | 067a82c1b39e3ca638213faef2492a94d9b7f340 | |
| parent | 6198c9de133d186a13bc9223c284416bb4a4f7bb (diff) | |
add target:fileconfig_add
| -rw-r--r-- | xmake/core/project/target.lua | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua index b00cbe15a..faf11b3cc 100644 --- a/xmake/core/project/target.lua +++ b/xmake/core/project/target.lua @@ -1280,6 +1280,24 @@ function _instance:fileconfig_set(sourcefile, info) self._FILESCONFIG = filesconfig end +-- add the config info to the given source file +function _instance:fileconfig_add(sourcefile, info) + local filesconfig = self._FILESCONFIG or {} + local fileconfig = filesconfig[sourcefile] + if fileconfig then + for k, v in pairs(info) do + if fileconfig[k] then + fileconfig[k] = table.join(fileconfig[k], v) + else + fileconfig[k] = v + end + end + else + filesconfig[sourcefile] = info + end + self._FILESCONFIG = filesconfig +end + -- get the source files function _instance:sourcefiles() |
