<div dir="ltr"><div>Hi everyone,<br><br></div><div>following Richard Smith's talk at CppCon this year where he mentioned that Clangs Module TS implementation,<br>while still work in progress, can already be used to build stuff, I decided to try it out.<br><br></div><div>So I compiled Clang 4.0 from svn, create a module interface file 'myclass.cppm' and a 'main.cpp' to test it.<br><br></div><div>I've gotten it to build successfully by executing<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><pre class="gmail-lang-cpp gmail-prettyprint gmail-prettyprinted"><code><span class="gmail-pln">clang</span><span class="gmail-pun">++</span><span class="gmail-pln"> </span><span class="gmail-pun">-</span><span class="gmail-pln">std</span><span class="gmail-pun">=</span><span class="gmail-pln">c</span><span class="gmail-pun">++</span><span class="gmail-lit">1z</span><span class="gmail-pln"> </span><span class="gmail-pun">-</span><span class="gmail-pln">fmodules</span><span class="gmail-pun">-</span><span class="gmail-pln">ts </span><span class="gmail-pun">--</span><span class="gmail-pln">precompile </span><span class="gmail-pun">-</span><span class="gmail-pln">o myclass</span><span class="gmail-pun">.</span><span class="gmail-pln">pcm myclass</span><span class="gmail-pun">.</span><span class="gmail-pln">cppm
clang</span><span class="gmail-pun">++</span><span class="gmail-pln"> </span><span class="gmail-pun">-</span><span class="gmail-pln">std</span><span class="gmail-pun">=</span><span class="gmail-pln">c</span><span class="gmail-pun">++</span><span class="gmail-lit">1z</span><span class="gmail-pln"> </span><span class="gmail-pun">-</span><span class="gmail-pln">fmodules</span><span class="gmail-pun">-</span><span class="gmail-pln">ts </span><span class="gmail-pun">-</span><span class="gmail-pln">fmodule</span><span class="gmail-pun">-</span><span class="gmail-pln">file</span><span class="gmail-pun">=</span><span class="gmail-pln">myclass</span><span class="gmail-pun">.</span><span class="gmail-pln">pcm </span><span class="gmail-pun">-</span><span class="gmail-pln">o modules_test main</span><span class="gmail-pun">.</span><span class="gmail-pln">cpp</span></code></pre></blockquote><div><br></div><div>So far so good. But on the Modules FAQ page [1] it says:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The binary representation of modules is automatically generated by the compiler on an as-needed basis.<br></blockquote><div><br></div><div>Is this only implemented for Clang's "C++98 style modules" yet or am I missing a flag I need to pass to clang++<br></div><div>in order for it to precompile my module automatically? Currently neither of<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">clang++ -std=c++1z -fmodules-ts main.cpp <br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>clang++ -std=c++1z -fmodules-ts myclass.cppm main.cpp</div></blockquote><div>work.<br> <br></div><div>Best,<br></div><div>Manuel<br></div></div><br>[1] <a href="http://clang.llvm.org/docs/Modules.html#compilation-model">http://clang.llvm.org/docs/Modules.html#compilation-model</a> <br></div></div></div>