Conversation
d77bb37 to
5fa6d4a
Compare
2de8920 to
6dd8d89
Compare
|
gcc does not seem to support c++modules with pch very well ruki@0738bc1c5a27:/mnt/xmake/tests/projects/c++/modules/hello_with_pch$ xmake -rv
[ 1%]: compiling.release src/test.h
/usr/bin/gcc -c -m64 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -std=c++20 -I build/.objs/hello/linux/x86_64/release/src/cxx -fmodules-ts -D_GLIBCXX_USE_CXX11_ABI=0 -DNDEBUG -x c++-header -o build/.objs/hello/linux/x86_64/release/src/cxx/test.h.gch src/test.h
[ 2%]: <hello> generating.module.deps src/main.cpp
/usr/bin/gcc -E -x c++ -m64 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -std=c++20 -I build/.objs/hello/linux/x86_64/release/src/cxx -include test.h -D_GLIBCXX_USE_CXX11_ABI=0 -DNDEBUG src/main.cpp -o build/.gens/hello/linux/x86_64/release/rules/bmi/cache/modules/2d9b7c0b/main.cpp.i
[ 3%]: <hello> generating.module.deps src/hello.mpp
/usr/bin/gcc -E -x c++ -m64 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -std=c++20 -I build/.objs/hello/linux/x86_64/release/src/cxx -include test.h -D_GLIBCXX_USE_CXX11_ABI=0 -DNDEBUG src/hello.mpp -o build/.gens/hello/linux/x86_64/release/rules/bmi/cache/modules/2d9b7c0b/hello.mpp.i
[ 25%]: <hello> compiling.module.release hello
/usr/bin/gcc -c -m64 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -std=c++20 -I build/.objs/hello/linux/x86_64/release/src/cxx -include test.h -fmodules-ts -D_GLIBCXX_USE_CXX11_ABI=0 -DNDEBUG -fmodule-mapper=/tmp/.xmake999/250406/hello/src/hello.mpp -x c++ -o build/.objs/hello/linux/x86_64/release/src/hello.mpp.o src/hello.mpp
error: src/hello.mpp:1:1: error: module-declaration only permitted as first declaration, or ending a global module fragment
1 | module;
| ^~~~~~
src/hello.mpp:4:8: error: module-declaration only permitted as first declaration, or ending a global module fragment
4 | export module hello;
| ^~~~~~
src/hello.mpp:6:1: error: 'export' may only occur after a module interface declaration
6 | export namespace hello {
| ^~~~~~
|
well, modules and headerunits are glorified pch, so i don't think it's a real use case anyway |
|
i have a PR that touch a lot module support, should i wait for this to be merge and update this PR or rebase on this PR and wait for this to merge ? |
you can open a pr to this prepare branch. the current dev branch will be released in these days. |
b98d617 to
b595022
Compare
|
why only some of the jobs are actually ran by the jobgraph ? local scanjob = group .. "/scan_module_dependencies"
jobgraph:add(scanjob, function()
for _, sourcefile in ipairs(sourcebatch.sourcefiles) do
local fileconfig = target:fileconfig(sourcefile)
local external = fileconfig and fileconfig.external
local jobname = group .. "/scan/" .. sourcefile
jobgraph:add(jobname, function(_, _, opt)
local changed = _scanner(target).scan_dependency_for(target, sourcefile, opt)
if changed then
support.memcache():set2(target:fullname(), "modules.changed", true)
end
end, {groups = {group .. "/scan"}})
jobgraph:add_orders(jobname, parsejob)
end
print(jobgraph:jobs())
end, {groups = {group}})
jobgraph:add_orders(scanjob, parsejob) |
use group |
|
@Arthapz try local scangroup = group .. "/scan_module_dependencies"
jobgraph:group(scangroup, function()
for _, sourcefile in ipairs(sourcebatch.sourcefiles) do
local fileconfig = target:fileconfig(sourcefile)
local external = fileconfig and fileconfig.external
local jobname = group .. "/scan/" .. sourcefile
jobgraph:add(jobname, function(_, _, opt)
local changed = _scanner(target).scan_dependency_for(target, sourcefile, opt)
if changed then
support.memcache():set2(target:fullname(), "modules.changed", true)
end
end)
end
end)
jobgraph:add_orders(scangroup, parsejob) |
it work thx |
|
@Arthapz I have merged it, you can open a pr to dev later. |
Okay |
#6202