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

2018-06-28 Thread Jason Heeris
On Thu, 28 Jun 2018 at 20:14, Jason Heeris wrote: > So I went and tried this on the real project, and it seems like compiling the static libs into a DLL doesn't give the same results as using the obj files directly, as per my initial list of commands. Namely, some symbols seem to not be getting ex

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

2018-06-28 Thread Jason Heeris
On Thu, 28 Jun 2018 at 08:18, Jason Heeris wrote: > > If those modules are not intended to be used outside of the final shader library, then why not to make them static libraries? > I'll test it on the real thing and see how that goes. The only problem I encountered was that the final shared libra

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

2018-06-28 Thread Innokentiy Alaytsev
Innokentiy Alaytsev wrote > 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

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

2018-06-28 Thread Innokentiy Alaytsev
Hello! Jason Heeris wrote > The only problem I encountered was that the final shared library complains > about having "NO SOURCES given to target: module3_dll". I can add > "module3.c" as a source, even though technically the static lib should > already contain everything from there. I'm not sure

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

2018-06-27 Thread Jason Heeris
On Thu, 28 Jun 2018 at 04:16, Innokentiy Alaytsev wrote: > I don't quite understand why are you using object libraries all over the project. Mainly because I tried a lot of things, and with the release of 3.12 I figured I'd try object libs again. > If those modules are not intended to be used ou

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

2018-06-27 Thread Innokentiy Alaytsev
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

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

2018-06-26 Thread Jason Heeris
On Wed, 27 Jun 2018 at 15:00, Innokentiy Alaytsev wrote: > Do you create declspec declaration by hand? It may worth looking at the > GenerateExportHeader > > Thanks, this will probably be very useful! > Is it the code that yo

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

2018-06-26 Thread Innokentiy Alaytsev
Hello! First of all, a side note: Jason Heeris wrote > (Not shown: the macros to create the declspec declaration that MSVC needs > to know what to export in the DLL. It's a type in moduleN and some > functions in common.) Do you create declspec declaration by hand? It may worth looking at the

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

2018-06-26 Thread Jason Heeris
This is a follow-on from "Linking object libraries into a Windows DLL in 3.12rc1"[1] - I figured since I'm reframing that question I should start a new thread. I have a project that has some common code and about a hundred modules. The modules can have dependencies on each other (only ever as a di