<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Wed, 27 Jun 2018 at 15:00, Innokentiy Alaytsev <<a href="mailto:alaitsev@gmail.com">alaitsev@gmail.com</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Do you create declspec declaration by hand? It may worth looking at the <br>
GenerateExportHeader<br>
<<a href="https://cmake.org/cmake/help/v3.7/module/GenerateExportHeader.html" rel="noreferrer" target="_blank">https://cmake.org/cmake/help/v3.7/module/GenerateExportHeader.html</a>> <br></blockquote><div><br></div><div>Thanks, this will probably be very useful!</div><div>  </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Is it the code that you use in your CMake build script or just a<br>
representation of the general idea?<br></blockquote><div><br></div><div>It's a representation, it's not in CMake at all currently, so anything's on the table. However, it's not a far stretch from the real build steps. Currently the build system is in another scripting language, which traverses the dependencies from the top-level module, listing all dependants recursively (no duplicates). It then compiles each one into an .obj file and finally links all the .obj files together. Rather than subject you to that, I've added a (very fragile) "build_manual.bat" file to that Gitlab repo. But it contains those cl.exe and link.exe commands, and produces a DLL with a single visible function, "module3()".</div><div><br></div><div>The fundamental problem here is simply one of scale. For my sample project, adding common, module1, module2 to module3's dependencies isn't hard. But when it's a couple of dozen dependencies, some of which may change from time to time, with different degrees of indirectness, flattening them all out would be very time consuming. As would finding and updating all parents when sub-sub-module deps change. Tracking direct dependencies only is far more manageable. Hope that makes sense.</div><div><br></div><div>Cheers,</div><div>Jason</div><div><br></div><div> </div></div></div>