I'm sure this diff will ruffle some feathers but there is no beating around the bush here, we have for too long been playing it fast and lose with our cmake build system treating it like it was a makefile on steroids
There's tons of implicit dependencies we have not expressed to cmake and to get around that we sprinkle all kinds of
- global defines
- long lists of fudged includes
- Linker hakcs
- repeated local defines over and over and over again, there's actually 40+ of this particular one, but I assume 3 examples will suffice here
hoping the compiler/linker will sort it all out in the end.
We don't have to live like this
This diff is the initial stab at making things better by using cmakes modern targets, we no longer have to worry about link order or fudging include directories or once more adding some defines required by a downstream dependency just to make things build/link
Upsides:
- Cmake will take care of most things given you setup the properties on the targets correctly and mark the dependencies between projects properly
Downsides:
- There is a fair bit of fudging we did in the past like giving a target X the include directory for clog (or guardedalloc, or...) but not tell cmake this target needs clog/guardedalloc to link, leading to the situation where you could build X without having to build clog. CMake puts a swift stop to that.
- It'll be *A LOT* of work
This is just an initial stab at this, with some low hanging fruit to get the conversation started. Especially in the 3rd party deps department this has the potential to clean up quite a bit of the messiness we have been experiencing.
It'll be a bumpy road, but I think it's a thing worth doing.