How can I manage building library projects that produce both a static lib and a dll?

Posted by Scott Langham on Stack Overflow See other posts from Stack Overflow or by Scott Langham
Published on 2010-12-08T17:14:37Z Indexed on 2011/01/14 2:53 UTC
Read the original article Hit count: 193

Filed under:
|
|
|

I've got a large visual studio solution with ~50 projects. There are configurations for StaticDebug, StaticRelease, Debug and Release. Some libraries are needed in both dll and static lib form. To get them, we rebuild the solution with a different configuration. The Configuration Manager window is used to setup which projects need to build in which flavours, static lib, dynamic dll or both.

This can by quite tricky to manage and it's a bit annoying to have to build the solution multiple times and select the configurations in the right order. Static versions need building before non-static versions.

I'm wondering, instead of this current scheme, might it be simpler to manage if, for the projects I needed to produce both a static lib and dynamc dll, I created two projects. Eg:

  • CoreLib
  • CoreDll

I could either make both of these projects reference all the same files and build them twice, or I'm wondering, would it be possible to build CoreLib and then get CoreDll to link it to generate the dll?

I guess my question is, do you have any advice on how to structure your projects in this kind of situation?

Thanks.

© Stack Overflow or respective owner

Related posts about c++

Related posts about visual-studio