<div class="__aliyun_email_body_block"><div  style="clear:both;"><span  style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#000000;">Hi all,</span></div><div  style="clear:both;"><span  style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#000000;"><br ></span></div><div  style="clear:both;"><span  style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#000000;">   Recently I am playing with C++20 modules and I found that the command line support of GCC</span></div><div  style="clear:both;"><span  style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#000000;">is much better than Clang. Here is an example:</span></div><div  style="clear:both;"><span  style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#000000;"><br ></span></div><div  style="clear:both;"><span  style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#000000;">```C++</span></div><div  style="clear:both;"><span  style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#000000;">// say_hello.cpp<br >module;<br >#include <iostream><br >#include <string_view><br >export module Hello;<br >export void SayHello<br >  (std::string_view const &name)<br >{<br >  std::cout << "Hello " << name << "!\n";<br >}</span></div><div  style="clear:both;"><span  style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#000000;">// main.cpp<br >#include <string_view><br >import Hello;<br >int main() {<br >  SayHello("world");<br >  return 0;<br >}</span></div><div  style="clear:both;"><span  style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#000000;">```</span></div><div  style="clear:both;"><span  style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#000000;"><br ></span></div><div  style="clear:both;">To compile the example, in gcc we need:</div><div  style="clear:both;">```</div><div  style="clear:both;">g++ -std=c++20 -fmodules-ts <span  style="caret-color:#000000;color:#000000;font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;font-style:normal;font-variant-caps:normal;font-weight:normal;text-align:start;text-indent:.0px;text-transform:none;background-color:#ffffff;text-decoration:none;float:none;display:inline;">say_hello.cpp </span>main.cpp <br ></div><div  style="clear:both;">```</div><div  style="clear:both;"><br ></div><div  style="clear:both;">And in clang, we need:</div><div  style="clear:both;">```</div><div  style="clear:both;"><p  style="margin:.0px;font-style:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:14.0px;line-height:normal;font-family:Helvetica;color:#121416;">clang++ -std=c++20 -fmodules-ts -Xclang -emit-module-interface -c say_hello.cpp -o Hello.pcm</p><p  style="margin:.0px;font-style:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:14.0px;line-height:normal;font-family:Helvetica;color:#121416;">clang++ -std=c++20 -fmodules-ts -fprebuilt-module-path=. main.cpp say_hello.cpp</p></div><div  style="clear:both;">```</div><div  style="clear:both;"><br ></div><div  style="clear:both;">Yeah, in clang we need to another line to emit module interface explicitly and another option</div><div  style="clear:both;">to tell the prebuilt-module-path. And in GCC, this happens by default, when GCC find it is compiling</div><div  style="clear:both;">a c++20 module, it would generate the module interface automatically to the path:</div><div  style="clear:both;">```</div><div  style="clear:both;"><div  class="lake-content" typography="classic" style="caret-color:#000000;color:#000000;font-style:normal;font-variant-caps:normal;font-weight:normal;text-align:start;text-indent:.0px;text-transform:none;text-decoration:none;">gcm.cache/filename.gcm</div></div><div  style="clear:both;">```</div><div  style="clear:both;">It would create `gcm.cache` in case it doesn't exist. </div><div  style="clear:both;"><br ></div><div  style="clear:both;">And GCC would search prebuilt module interface in `gcm.cache` automatically.</div><div  style="clear:both;"><br ></div><div  style="clear:both;">It looks much more friendly to me. The intention of this mail is to ask if you think it is the right direction</div><div  style="clear:both;">to make the clang's command line support for c++20 module more like GCC. The different I see now includes:</div><div  style="clear:both;">- Generate prebuilt module interface automatically. (And generate it to a specific directory automatically)</div><div  style="clear:both;">- Have a default value for <span  style="caret-color:#121416;color:#121416;font-family:Helvetica;font-size:14.0px;font-style:normal;font-variant-caps:normal;font-weight:normal;text-align:start;text-indent:.0px;text-transform:none;background-color:#ffffff;text-decoration:none;float:none;display:inline;">prebuilt module path.</span></div><div  style="clear:both;"><span  style="caret-color:#121416;color:#121416;font-family:Helvetica;font-size:14.0px;font-style:normal;font-variant-caps:normal;font-weight:normal;text-align:start;text-indent:.0px;text-transform:none;background-color:#ffffff;text-decoration:none;float:none;display:inline;"><br ></span></div><div  style="clear:both;"><span  style="caret-color:#121416;color:#121416;font-family:Helvetica;font-size:14.0px;font-style:normal;font-variant-caps:normal;font-weight:normal;text-align:start;text-indent:.0px;text-transform:none;background-color:#ffffff;text-decoration:none;float:none;display:inline;">I am wondering if any one more familiar with the clang's command line and file system would love to </span></div><div  style="clear:both;"><span  style="caret-color:#121416;color:#121416;font-family:Helvetica;font-size:14.0px;font-style:normal;font-variant-caps:normal;font-weight:normal;text-align:start;text-indent:.0px;text-transform:none;background-color:#ffffff;text-decoration:none;float:none;display:inline;">support this (I am not so familiar with it). <span  style="caret-color:#121416;color:#121416;font-family:Helvetica;font-size:14.0px;font-style:normal;font-variant-caps:normal;font-weight:normal;text-align:start;text-indent:.0px;text-transform:none;background-color:#ffffff;text-decoration:none;float:none;display:inline;">Although It may take more time, </span>I would love to support if others are busy.</span></div><div  style="clear:both;"><span  style="caret-color:#121416;color:#121416;font-family:Helvetica;font-size:14.0px;font-style:normal;font-variant-caps:normal;font-weight:normal;text-align:start;text-indent:.0px;text-transform:none;background-color:#ffffff;text-decoration:none;float:none;display:inline;"><br ></span></div><div  style="clear:both;"><span  style="caret-color:#121416;color:#121416;font-family:Helvetica;font-size:14.0px;font-style:normal;font-variant-caps:normal;font-weight:normal;text-align:start;text-indent:.0px;text-transform:none;background-color:#ffffff;text-decoration:none;float:none;display:inline;">Thanks,</span></div><div  style="clear:both;"><span  style="caret-color:#121416;color:#121416;font-family:Helvetica;font-size:14.0px;font-style:normal;font-variant-caps:normal;font-weight:normal;text-align:start;text-indent:.0px;text-transform:none;background-color:#ffffff;text-decoration:none;float:none;display:inline;">Chuanqi</span></div></div>