diff options
| author | ruki <[email protected]> | 2026-03-29 22:49:37 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2026-03-29 22:49:41 +0800 |
| commit | 1bccfc273af2b1d579d033324bca481e15c58653 (patch) | |
| tree | 192697793bd61d48b4423da0ac4a1eab804d80dc /xmake/rules/c++/modules | |
| parent | f4513cc28aa778e1ad0d050511cc7e295fe81e32 (diff) | |
fix const limit on lua5.5
Diffstat (limited to 'xmake/rules/c++/modules')
| -rw-r--r-- | xmake/rules/c++/modules/builder.lua | 4 | ||||
| -rw-r--r-- | xmake/rules/c++/modules/clang/builder.lua | 1 | ||||
| -rw-r--r-- | xmake/rules/c++/modules/clang/support.lua | 2 | ||||
| -rw-r--r-- | xmake/rules/c++/modules/gcc/support.lua | 2 | ||||
| -rw-r--r-- | xmake/rules/c++/modules/msvc/builder.lua | 1 |
5 files changed, 10 insertions, 0 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..d0e73b304 100644 --- a/xmake/rules/c++/modules/clang/support.lua +++ b/xmake/rules/c++/modules/clang/support.lua @@ -49,6 +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 + local line = line line = line:trim() if line:startswith("#") and line:find("/vector\"", 1, true) then local includedir = line:match("\"(.+)/vector\"") @@ -164,6 +165,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 + local line = line line = line:trim() if os.isdir(line) then table.insert(includedirs, path.normalize(line)) diff --git a/xmake/rules/c++/modules/gcc/support.lua b/xmake/rules/c++/modules/gcc/support.lua index 4de7d6eab..62cdd37f9 100644 --- a/xmake/rules/c++/modules/gcc/support.lua +++ b/xmake/rules/c++/modules/gcc/support.lua @@ -38,6 +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 + local line = line line = line:trim() if line:startswith("#") and line:find("/vector\"", 1, true) then local includedir = line:match("\"(.+)/vector\"") @@ -114,6 +115,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 + local line = line line = line:trim() if os.isdir(line) then table.insert(includedirs, path.normalize(line)) 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 |
