I am trying to let xmake support gcc-11 to build c++20 modules, but I have some problems.
gcc-11 will generate the gcm.cache directory in the current directory by default. How can I modify this default path to the specified other directory?
I know that clang has a -fmodules-cache-path= option to modify the cache path of modules, but I did not find a similar option for gcc.
Does anyone know? thanks
This worked for me
gcc-11on ubuntu 22.04 (Makefile fragment):The caveat I ran into is that
g++-mapper-serverwon't create the root directory, so make sure its created first. You'll still have to work out dependencies so that the gcm is created/updated before the importing code is compiled.The explanation is
|invokes a mapper process via pipe,@resolves the process name from the gcc tools directory (cf gcc manual). The-roption sets the root directory. Take care protecting the spaces and the|frommakeand shell.The default mapper server takes arguments - you can tweak and play with it - here's the options on my version: