diff options
| author | ruki <[email protected]> | 2025-07-31 23:32:31 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-07-31 23:32:31 +0800 |
| commit | cf59b0d2890715666ff1a30631f7541cebf5f48e (patch) | |
| tree | d0e1598b1177260c94bd33087c6bb699db3269bb | |
| parent | c3fc9f283a3d30bfabe0e57a1d8fe7b9e7bfa8c2 (diff) | |
fix remove files #6652
| -rw-r--r-- | xmake/core/project/target.lua | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua index 4923283f6..78719105b 100644 --- a/xmake/core/project/target.lua +++ b/xmake/core/project/target.lua @@ -2002,13 +2002,14 @@ function _instance:sourcefiles() removed = true end - -- find source files and try to cache the matching results of os.match across targets - -- @see https://github.com/xmake-io/xmake/issues/1353 - local results = targetcache:get2("sourcefiles", file) - if not results then - if removed then - results = {file} - else + local results + if removed then + results = {file} + else + -- find source files and try to cache the matching results of os.match across targets + -- @see https://github.com/xmake-io/xmake/issues/1353 + results = targetcache:get2("sourcefiles", file) + if results == nil then results = os.files(file) if #results == 0 then -- attempt to find source directories if maybe compile it as directory with the custom rules |
