Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix incremental compilation for gcc-14 #5022 #5030

Merged
merged 1 commit into from
Apr 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading