summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules
diff options
context:
space:
mode:
authorruki <[email protected]>2026-04-01 21:02:03 +0800
committerGitHub <[email protected]>2026-04-01 21:02:03 +0800
commit39fd35ea9d5d14079e4669b85423d488c9097cd4 (patch)
tree7d4452174422931fe8a56f49b2d349b4b7cc90b3 /xmake/rules/c++/modules
parent75b084fa57f2fe00f369d9cac3878c03da43a68a (diff)
parentc63ac2d50545f2f58872c5be9a46d8fb5b3e8016 (diff)
Merge pull request #7437 from xmake-io/lua55
update to lua5.5
Diffstat (limited to 'xmake/rules/c++/modules')
-rw-r--r--xmake/rules/c++/modules/builder.lua4
-rw-r--r--xmake/rules/c++/modules/clang/builder.lua1
-rw-r--r--xmake/rules/c++/modules/clang/support.lua4
-rw-r--r--xmake/rules/c++/modules/gcc/support.lua4
-rw-r--r--xmake/rules/c++/modules/msvc/builder.lua1
5 files changed, 10 insertions, 4 deletions
diff --git a/xmake/rules/c++/modules/builder.lua b/xmake/rules/c++/modules/builder.lua
index 761b2cf6c..6d82cca0b 100644
--- a/xmake/rules/c++/modules/builder.lua
+++ b/xmake/rules/c++/modules/builder.lua
@@ -91,6 +91,7 @@ function _get_jobdeps(target, module, jobgraph, buildfilejob)
local jobdeps = {}
local moduletype = support.has_two_phase_compilation_support(target) and "bmi" or "onephase"
for dep_name, dep in pairs(module.deps) do
+ local dep_name = dep_name
if dep.headerunit then
dep_name = dep_name .. dep.key
end
@@ -347,6 +348,7 @@ function build_modules_for_batchjobs(target, batchjobs, built_modules, opt)
local jobs
local moduletype = has_two_phase_compilation_support and "bmi" or "onephase"
for _, sourcefile in ipairs(_built_modules) do
+ local sourcefile = sourcefile
jobs = jobs or {}
local bmionly = support.is_bmionly(target, sourcefile)
local module = mapper.get(target, sourcefile)
@@ -354,6 +356,7 @@ function build_modules_for_batchjobs(target, batchjobs, built_modules, opt)
local buildfilejob = _get_module_buildfilejob_for(target, sourcefile, moduletype)
local deps = {}
for dep_name, dep in pairs(module.deps) do
+ local dep_name = dep_name
if dep.headerunit then
dep_name = dep_name .. dep.key
end
@@ -409,6 +412,7 @@ function build_objectfiles_for_batchjobs(target, batchjobs, built_modules, opt)
local jobs
for _, sourcefile in ipairs(_built_modules) do
+ local sourcefile = sourcefile
if not support.is_bmionly(target, sourcefile) then
jobs = jobs or {}
local module = mapper.get(target, sourcefile)
diff --git a/xmake/rules/c++/modules/clang/builder.lua b/xmake/rules/c++/modules/clang/builder.lua
index 60f2186e5..4839733e0 100644
--- a/xmake/rules/c++/modules/clang/builder.lua
+++ b/xmake/rules/c++/modules/clang/builder.lua
@@ -234,6 +234,7 @@ function _get_requiresflags(target, module)
if not requiresflags or requires_changed then
requiresflags = {}
for required, dep in table.orderpairs(module.deps) do
+ local required = required
if dep.headerunit then
required = required .. dep.key
end
diff --git a/xmake/rules/c++/modules/clang/support.lua b/xmake/rules/c++/modules/clang/support.lua
index 4bf5832a6..b1699d21a 100644
--- a/xmake/rules/c++/modules/clang/support.lua
+++ b/xmake/rules/c++/modules/clang/support.lua
@@ -49,7 +49,7 @@ function _get_toolchain_includedirs_for_stlheaders(target, includedirs, clang)
local result = try {function () return os.iorunv(clang, argv, {envs = compinst:runenvs()}) end}
if result then
for _, line in ipairs(result:split("\n", {plain = true})) do
- line = line:trim()
+ local line = line:trim()
if line:startswith("#") and line:find("/vector\"", 1, true) then
local includedir = line:match("\"(.+)/vector\"")
if includedir and os.isdir(includedir) then
@@ -164,7 +164,7 @@ function toolchain_includedirs(target)
local _, result = try {function () return os.iorunv(clang, table.join({"-E", "-Wp,-v", "-xc++", os.nuldev()}, runtime_flag or {})) end}
if result then
for _, line in ipairs(result:split("\n", {plain = true})) do
- line = line:trim()
+ local line = line:trim()
if os.isdir(line) then
table.insert(includedirs, path.normalize(line))
elseif line:startswith("End") then
diff --git a/xmake/rules/c++/modules/gcc/support.lua b/xmake/rules/c++/modules/gcc/support.lua
index 4de7d6eab..1204d207d 100644
--- a/xmake/rules/c++/modules/gcc/support.lua
+++ b/xmake/rules/c++/modules/gcc/support.lua
@@ -38,7 +38,7 @@ function _get_toolchain_includedirs_for_stlheaders(includedirs, gcc)
local result = try {function () return os.iorunv(gcc, {"-E", "-x", "c++", tmpfile}) end}
if result then
for _, line in ipairs(result:split("\n", {plain = true})) do
- line = line:trim()
+ local line = line:trim()
if line:startswith("#") and line:find("/vector\"", 1, true) then
local includedir = line:match("\"(.+)/vector\"")
if includedir and os.isdir(includedir) then
@@ -114,7 +114,7 @@ function toolchain_includedirs(target)
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()
+ local line = line:trim()
if os.isdir(line) then
table.insert(includedirs, path.normalize(line))
elseif line:startswith("End") then
diff --git a/xmake/rules/c++/modules/msvc/builder.lua b/xmake/rules/c++/modules/msvc/builder.lua
index b59115477..46496609c 100644
--- a/xmake/rules/c++/modules/msvc/builder.lua
+++ b/xmake/rules/c++/modules/msvc/builder.lua
@@ -189,6 +189,7 @@ function _get_requiresflags(target, module)
if not requiresflags or requires_changed then
local deps_flags = {}
for required, dep in pairs(module.deps) do
+ local required = required
if dep.headerunit then
required = required .. dep.key
end