On Wed, 1 Feb 2023 at 10:53, HHN via Gcc-help <gcc-help@xxxxxxxxxxx> wrote: > > I have been working on upgrading the HPX build system to support C++ > modules, while trying to experiment with GCC support for C++ modules, I > keep running into this issue of unrecognized command-line options. > > ` > g++: error: unrecognized command-line option > ‘-fdep-file=CMakeFiles/std_module_example.dir/t3.cxx.o.ddi’ > g++: error: unrecognized command-line option > ‘-fdep-output=CMakeFiles/std_module_example.dir/t3.cxx.o’ > g++: error: unrecognized command-line option ‘-fdep-format=trtbd’ [...] > I have tried this with g++ 11.3, g++ 12.1 installed using ubuntu package > managers, As you were told in the cmake forum by Ben B., the patches to add -fdep-file etc. are not yet in GCC, so of course it doesn't work with releases from more than a year ago. > I have also tried the same using this certain patch > <https://github.com/mathstuf/gcc/tree/p1689r5> as suggested by the user on > an online forum > <https://discourse.cmake.org/t/module-support-for-g-and-clang/7367/2>. That user is the person who wrote the patch to add -fdep-file, so you should listen to them. If it still doesn't work with that patch, then you probably didn't apply the patch correctly. > I have also tried the same using the master > <https://github.com/gcc-mirror/gcc> and devel/c++-modules > <https://github.com/gcc-mirror/gcc/tree/devel/c++-modules> branch on gcc > repo. Obviously it's not going to work with those branches, because the patches to add -fdep-file support are not part of GCC yet, as Ben B. already told you. > All of them have given the same errors. Also the devel/c++-modules branch > compiles to g++ version of g++ (GCC) 11.0.0 20210203 (experimental) > [c++-modules revision 20230201-1505], while the master branch has > version g++ (GCC) 13.0.1 20230201 (experimental). Don't use the devel/c++-modules branch. It was used two+ years ago for the initial work on modules, but the master branch now has all that work and numerous improvements.