Skip to content

Commit

Permalink
fix includes
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Jan 4, 2025
1 parent 59d4ebf commit 5bf1f7f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion xmake/core/base/interpreter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5bf1f7f

Please sign in to comment.