On Wed, 27 Jun 2018 at 15:00, Innokentiy Alaytsev <alait...@gmail.com>
wrote:

> Do you create declspec declaration by hand? It may worth looking at the
> GenerateExportHeader
> <https://cmake.org/cmake/help/v3.7/module/GenerateExportHeader.html>
>

Thanks, this will probably be very useful!


> Is it the code that you use in your CMake build script or just a
> representation of the general idea?
>

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()".

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.

Cheers,
Jason
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

Reply via email to