summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/modules_support/clang.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/rules/c++/modules/modules_support/clang.lua')
-rw-r--r--xmake/rules/c++/modules/modules_support/clang.lua38
1 files changed, 19 insertions, 19 deletions
diff --git a/xmake/rules/c++/modules/modules_support/clang.lua b/xmake/rules/c++/modules/modules_support/clang.lua
index 49dbee0a2..666eb2135 100644
--- a/xmake/rules/c++/modules/modules_support/clang.lua
+++ b/xmake/rules/c++/modules/modules_support/clang.lua
@@ -62,34 +62,34 @@ function check_module_support(target)
end
function toolchain_include_directories(target)
- local includedirs = _g.includedirs
- if includedirs == nil then
+ local includedirs = _g.includedirs
+ if includedirs == nil then
includedirs = {}
- local gcc, toolname = target:tool("cc")
- assert(toolname, "clang")
-
- local _, result = try {function () return os.iorunv(gcc, {"-E", "-Wp,-v", "-xc", os.nuldev()}) end}
- if result then
- for _, line in ipairs(result:split("\n", {plain = true})) do
- line = line:trim()
- if os.isdir(line) then
+ local gcc, toolname = target:tool("cc")
+ assert(toolname, "clang")
+
+ local _, result = try {function () return os.iorunv(gcc, {"-E", "-Wp,-v", "-xc", os.nuldev()}) end}
+ if result then
+ for _, line in ipairs(result:split("\n", {plain = true})) do
+ line = line:trim()
+ if os.isdir(line) then
table.append(includedirs, line)
- break
- elseif line:startswith("End") then
- break
- end
- end
+ break
+ elseif line:startswith("End") then
+ break
+ end
+ end
end
_g.includedirs = includedirs or {}
- end
+ end
return includedirs
end
function generate_dependencies(target, sourcebatch, opt)
local cachedir = common.get_cache_dir(target)
- for _, sourcefile in ipairs(sourcebatch.sourcefiles) do
+ for _, sourcefile in ipairs(sourcebatch.sourcefiles) do
local dependfile = target:dependfile(sourcefile)
depend.on_changed(function()
progress.show(opt.progress, "${color.build.object}generating.cxx.module.deps %s", sourcefile)
@@ -229,7 +229,7 @@ function build_modules(target, batchcmds, objectfiles, modules, opt)
batchcmds:set_depcache(target:dependfile(bmifile))
table.join2(flag, { modulefileflag .. bmifile })
- end
+ end
batchcmds:vrunv(compinst:program(), table.join(compinst:compflags({target = target}), common_args, args))
batchcmds:vrunv(compinst:program(), table.join(compinst:compflags({target = target}), common_args, bmifiles, {"-c", "-o", objectfile}))
@@ -381,4 +381,4 @@ function has_headerunitsupport(target)
_g.support_headerunits = support_headerunits or false
end
return support_headerunits
-end \ No newline at end of file
+end