The C++ (and C, though it matters less there) standard states that all translation units in a program need to have the same definition; and that includes things like compiler switches. For instance, on MSVC++, one must link to the right version of the C runtime library (/MT
versus /MD
versus /MTd
versus /MDd
) in all translation units.
However, there are a couple of third party dependencies we'd like to use, and there are a couple of things:
- They all use different build systems (There's an autoconf, there's a cmake, and there's one which seems to have it's own hand-rolled thing..)
- The build systems don't all expose these kinds of switches in their configuration, and the ones which are hard-coded are set differently in different systems. (E.g. one library forces
/MD
and/MDd
, while another forces/MT
and/MTd
)
We aren't sure what the best way to handle these kinds of things are. We have discussed the following options:
- Build our own build system around whatever third party dependencies.
- PRO: We know things will match
- PRO: We know that we can do cross platform support the right way
- CON: We don't know exactly how each of the third party build systems work
- CON: Lots and lots of work
- CON: Breaks if the third party dependency changes
- Try to use the third party build systems, and try to modify them to do what we need.
- PRO: Seems to be less work
- CON: We might break the third party system
- CON: Breaks if the third party dependency changes
- CON: Forces our own build to be really complicated
We don't know what to do though; and we can't believe that we are alone in having these kinds of issues. Should we do one of those options above, or some third alternative that I've not thought of?