summaryrefslogtreecommitdiff
path: root/xmake
diff options
context:
space:
mode:
authorArthur LAURENT <[email protected]>2023-08-26 22:37:02 +0200
committerArthur LAURENT <[email protected]>2023-08-27 01:22:16 +0200
commit463b3679b2a3665bf39c7f0d7ded496cf3ce1e4d (patch)
treef0d62bd636b5b46207587a861f47fa66dd8ef5ef /xmake
parente255c709d260481ee7def19c95a8d53795c6e828 (diff)
fix find_angle_header_file
Diffstat (limited to 'xmake')
-rw-r--r--xmake/rules/c++/modules/modules_support/common.lua16
1 files changed, 8 insertions, 8 deletions
diff --git a/xmake/rules/c++/modules/modules_support/common.lua b/xmake/rules/c++/modules/modules_support/common.lua
index 2ff24023b..d42d0f958 100644
--- a/xmake/rules/c++/modules/modules_support/common.lua
+++ b/xmake/rules/c++/modules/modules_support/common.lua
@@ -474,16 +474,12 @@ end
function find_angle_header_file(target, file)
local headerpaths = modules_support(target).toolchain_includedirs(target)
for _, dep in ipairs(target:orderdeps()) do
- local includedirs = dep:get("sysincludedirs") or dep:get("includedirs")
- if includedirs then
- table.join2(headerpaths, includedirs)
- end
+ local includedirs = table.join(dep:get("sysincludedirs") or {}, dep:get("includedirs") or {})
+ table.join2(headerpaths, includedirs)
end
for _, pkg in pairs(target:pkgs()) do
- local includedirs = pkg:get("sysincludedirs") or pkg:get("includedirs")
- if includedirs then
- table.join2(headerpaths, includedirs)
- end
+ local includedirs = table.join(pkg:get("sysincludedirs") or {}, pkg:get("includedirs") or {})
+ table.join2(headerpaths, includedirs)
end
table.join2(headerpaths, target:get("includedirs"))
local p = find_file(file, headerpaths)
@@ -534,6 +530,9 @@ function fallback_generate_dependencies(target, jsonfile, sourcefile, preprocess
sourcecode = sourcecode:gsub("//.-\n", "\n")
sourcecode = sourcecode:gsub("/%*.-%*/", "")
for _, line in ipairs(sourcecode:split("\n", {plain = true})) do
+ if line:match("#") then
+ goto continue
+ end
if not module_name_export then
module_name_export = line:match("export%s+module%s+(.+)%s*;") or line:match("export%s+__preprocessed_module%s+(.+)%s*;")
end
@@ -572,6 +571,7 @@ function fallback_generate_dependencies(target, jsonfile, sourcefile, preprocess
table.insert(module_deps, module_dep)
module_deps_set:insert(module_depname)
end
+ ::continue::
end
if module_name_export or internal then