diff options
| author | ruki <[email protected]> | 2025-01-05 08:52:50 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-01-05 08:52:50 +0800 |
| commit | 90c611a8ff57e2d5fd271943b5bb4f3b78eb8026 (patch) | |
| tree | 28e4d69eea88f96c586de84a12b1f61ba74344e2 | |
| parent | 59d4ebf3e100a4de90708e0cddf50b61bbd89802 (diff) | |
| parent | 5bf1f7fc78bc95c8360eb2b004481b3e85769897 (diff) | |
Merge pull request #6041 from xmake-io/includes
fix includes
| -rw-r--r-- | xmake/core/base/interpreter.lua | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/xmake/core/base/interpreter.lua b/xmake/core/base/interpreter.lua index c8cdd9773..f23e064cf 100644 --- a/xmake/core/base/interpreter.lua +++ b/xmake/core/base/interpreter.lua @@ -1712,7 +1712,16 @@ function interpreter:api_builtin_includes(...) end -- find the given files from the project directory if not found then - local files = os.match(subpath, not subpath:endswith(".lua")) + local files + if subpath:endswith(".lua") then + files = os.files(subpath) + else + -- @see https://github.com/xmake-io/xmake/issues/6026 + local file = path.join(subpath, path.filename(curfile)) + if os.isfile(file) then + files = {file} + end + end if files and #files > 0 then table.join2(subpaths_matched, files) found = true |
