Skip to content

Commit

Permalink
Merge pull request #5030 from xmake-io/gcc14
Browse files Browse the repository at this point in the history
fix incremental compilation for gcc-14 #5022
  • Loading branch information
waruqi committed Apr 29, 2024
2 parents 1d3ff91 + 1f63fff commit 719a40b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions xmake/rules/c++/modules/modules_support/gcc/builder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,15 @@ end
function _generate_modulemapper_file(target, module, cppfile)
local maplines = _get_maplines(target, module)
local mapper_path = path.join(os.tmpdir(), target:name():replace(" ", "_"), name or cppfile:replace(" ", "_"))
local mapper_file = io.open(mapper_path, "wb")
mapper_file:write("root " .. path.unix(os.projectdir()))
mapper_file:write("\n")
local mapper_content = {}
table.insert(mapper_content, "root " .. path.unix(os.projectdir()))
for _, mapline in ipairs(maplines) do
mapper_file:write(mapline)
mapper_file:write("\n")
table.insert(mapper_content, mapline)
end
mapper_content = table.concat(mapper_content, "\n") .. "\n"
if not os.isfile(mapper_path) or io.readfile(mapper_path, {encoding = "binary"}) ~= mapper_content then
io.writefile(mapper_path, mapper_content, {encoding = "binary"})
end
mapper_file:close()
return mapper_path
end

Expand Down

0 comments on commit 719a40b

Please sign in to comment.