[CMake] How can I compile and link modular code into a single DLL with MSVC?

Innokentiy Alaytsev alaitsev at gmail.com
Wed Jun 27 14:16:39 EDT 2018


Hello!I've looked through the sources in your repo. I don't have CMake 3.12
right now, so I could not build it (Object library target "module1" may not
link to anything). But that's not important.I don't quite understand why are
you using object libraries all over the project. If those modules are not
intended to be used outside of the final shader library, then why not to
make them static libraries? (Sorry me, please, for just asking without
trying)Also, I have an important note about the structure of the project: It
may be better to have all the dependencies defined before they are used,
i.e. you should not be able to use the target_link_libraries() with an
undefined target as a linked library.Unfortunately, I don't have any example
for you. The closest to what you describe could be a horrible abomination
the project that optionally fetches dependencies from the remote repo and
adds them as subdirectories to build and link to them (just like in  this
example project <https://github.com/Crascit/DownloadProject>  , but uglier).
This seems rather close to what you want to me because dependency of the
main project is built into a separate library that is linked to the final
artefact.Best regards,Innokentiy Alaytsev 



--
Sent from: http://cmake.3232098.n2.nabble.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20180627/b3f06d32/attachment.html>


More information about the CMake mailing list