diff options
| author | ruki <[email protected]> | 2025-04-14 22:42:09 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-04-14 10:13:21 +0800 |
| commit | 9b93dd31192b7edc7ba5ec492fc1d754254626c9 (patch) | |
| tree | 87e3d5929fac28d424d5607848e1e507967f1451 | |
| parent | 62251f56eb7700129cf61994c4db0f4ef25df649 (diff) | |
fix package and headerunit for gcc
3 files changed, 16 insertions, 10 deletions
diff --git a/xmake/rules/c++/modules/modules_support/clang/builder.lua b/xmake/rules/c++/modules/modules_support/clang/builder.lua index ec6692c35..420d1f0ee 100644 --- a/xmake/rules/c++/modules/modules_support/clang/builder.lua +++ b/xmake/rules/c++/modules/modules_support/clang/builder.lua @@ -409,7 +409,8 @@ function make_headerunit_buildjobs(target, job_name, batchjobs, headerunit, bmif local depvalues = {compinst:program(), compflags} if opt.build then - progress.show(jobopt.progress, "${color.build.target}<%s> ${clear}${color.build.object}compiling.headerunit.$(mode) %s", target:fullname(), headerunit.name) + progress.show(jobopt.progress, "${color.build.target}<%s> ${clear}${color.build.object}compiling.headerunit.$(mode) %s", + target:fullname(), headerunit.name) _compile(target, _make_headerunitflags(target, headerunit, bmifile), headerunit.path, bmifile) end @@ -457,8 +458,9 @@ function make_headerunit_buildcmds(target, batchcmds, headerunit, bmifile, outpu add_headerunit_to_target_mapper(target, headerunit, bmifile) if opt.build then - local name = headerunit.unique and headerunit.name or headerunit.path - batchcmds:show_progress(opt.progress, "${color.build.target}<%s> ${clear}${color.build.object}compiling.headerunit.$(mode) %s", target:fullname(), name) + local headerfile = headerunit.unique and headerunit.name or headerunit.path + batchcmds:show_progress(opt.progress, "${color.build.target}<%s> ${clear}${color.build.object}compiling.headerunit.$(mode) %s" + , target:fullname(), headerfile) _batchcmds_compile(batchcmds, target, _make_headerunitflags(target, headerunit, bmifile), bmifile) end batchcmds:add_depfiles(headerunit.path) diff --git a/xmake/rules/c++/modules/modules_support/compiler_support.lua b/xmake/rules/c++/modules/modules_support/compiler_support.lua index 554b536cf..fea294ad8 100644 --- a/xmake/rules/c++/modules/modules_support/compiler_support.lua +++ b/xmake/rules/c++/modules/modules_support/compiler_support.lua @@ -134,7 +134,7 @@ end function find_quote_header_file(target, sourcefile, file) local p = path.join(path.directory(path.absolute(sourcefile, project.directory())), file) - assert(os.isfile(p)) + assert(os.isfile(p), "\"%s\" not found", p) return p end @@ -150,7 +150,7 @@ function find_angle_header_file(target, file) end table.join2(headerpaths, target:get("includedirs")) local p = find_file(file, headerpaths) - assert(p, "find <%s> not found!", file) + assert(p, "<%s> not found!", file) return p end diff --git a/xmake/rules/c++/modules/modules_support/gcc/builder.lua b/xmake/rules/c++/modules/modules_support/gcc/builder.lua index 4033eefd5..1f909623f 100644 --- a/xmake/rules/c++/modules/modules_support/gcc/builder.lua +++ b/xmake/rules/c++/modules/modules_support/gcc/builder.lua @@ -387,9 +387,10 @@ function make_headerunit_buildjobs(target, job_name, batchjobs, headerunit, bmif if option.get("diagnosis") then print("mapper file:\n%s", io.readfile(headerunit_mapper)) end + local headerfile = headerunit.unique and headerunit.name or headerunit.path _compile(target, _make_headerunitflags(target, headerunit, headerunit_mapper, opt), - path.translate(path.filename(headerunit.name)), bmifile) + path.translate(headerfile), bmifile) os.tryrm(headerunit_mapper) end @@ -421,13 +422,15 @@ function make_headerunit_jobgraph(target, job_name, jobgraph, headerunit, bmifil if opt.build then local headerunit_mapper = _generate_headerunit_modulemapper_file({name = path.normalize(headerunit.path), bmifile = bmifile}) - progress.show(jobopt.progress, "${color.build.target}<%s> ${clear}${color.build.object}compiling.headerunit.$(mode) %s", target:fullname(), headerunit.name) + progress.show(jobopt.progress, "${color.build.target}<%s> ${clear}${color.build.object}compiling.headerunit.$(mode) %s", + target:fullname(), headerunit.name) if option.get("diagnosis") then print("mapper file:\n%s", io.readfile(headerunit_mapper)) end + local headerfile = headerunit.unique and headerunit.name or headerunit.path _compile(target, _make_headerunitflags(target, headerunit, headerunit_mapper, opt), - path.translate(path.filename(headerunit.name)), bmifile) + path.translate(headerfile), bmifile) os.tryrm(headerunit_mapper) end @@ -450,8 +453,9 @@ function make_headerunit_buildcmds(target, batchcmds, headerunit, bmifile, outpu add_headerunit_to_target_mapper(target, _headerunit, bmifile) if opt.build then - local name = headerunit.unique and headerunit.name or headerunit.path - batchcmds:show_progress(opt.progress, "${color.build.target}<%s> ${clear}${color.build.object}compiling.headerunit.$(mode) %s", target:fullname(), name) + local headerfile = headerunit.unique and headerunit.name or headerunit.path + batchcmds:show_progress(opt.progress, "${color.build.target}<%s> ${clear}${color.build.object}compiling.headerunit.$(mode) %s", + target:fullname(), headerfile) if option.get("diagnosis") then batchcmds:print("mapper file:\n%s", io.readfile(headerunit_mapper)) end |
