<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 13 May 2017 at 03:40, Boris Kolpackov <span dir="ltr"><<a href="mailto:boris@codesynthesis.com" target="_blank">boris@codesynthesis.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Richard,<br>
<span class=""><br>
Richard Smith <<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>> writes:<br>
<br>
> The intent is that the same set of flags would typically be passed to a<br>
> compilation building the module interface for a particular module as would<br>
> be passed to a compilation building the module interface.<br>
<br>
</span>Should the second "module interface" be "module user (importer)"?</blockquote><div><br></div><div>No, it should be "module implementation", sorry. That is, you can have somewhat different flags between module interface and module user, but the entire module (both interface and implementation) would typically be expected to be built with a similar set of flags, determined principally by the module author. That's not required, though, and if a build system wants to set things up differently, it can.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
> That way, the user can decide on a per-module basis how they want the<br>
> compiler to act (including things like which warnings they want enabled<br>
> for their module, and perhaps some details of the language it's written in).<br>
<br>
</span>Interesting. So this implies that the module binary interface (.pcm) is<br>
a user-side (or per-user) thing, not module-side?<br>
<br>
In other words, if I have library libx that implements modx and I have<br>
two programs, exe1 and exe2, that use/link this module/library, then,<br>
I may need to generate two modx.pcm versions, one for each exe if they<br>
are built with different-enough flags (actually, three: +1 for libx's<br>
module implementation units).<br></blockquote><div><br></div><div>If the above are all part of the same build system, building a project with largely the same configuration throughout, I would expect the same libx.pcm would be used in all three cases. But yes, if the flags are different enough (perhaps one compilation is C++1z, another is Objective-C++11, and a third one is targeting a different architecture), then the .pcm file can't be reused, so you would need to rebuild it for each sufficiently-different user. (Although in those cases, you'd often want different object files for the module implementation, too.)</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This makes sense if you start thinking about inline functions, warnings,<br>
etc. But definitely not how I (and I bet a lot of other people) think<br>
about it.<br>
<br>
I also wonder how this model applies to the standard library? Will each<br>
project that consumes it as a module have to compile its module interface?</blockquote><div><br></div><div>Typically yes (but only once).</div></div></div></div>