There should be a way to define different kinds of targets
Bonus
I would really like if we could pull off something like this example (but as a first-class citizen)
add_library(xxx-objects OBJECT ${SRC})
add_library(xxx-static STATIC $<TARGET_OBJECTS:xxx-objects>)
add_library(xxx-shared SHARED $<TARGET_OBJECTS:xxx-objects>)
This is an example of advanced CMake, that allows to create 2 artifacts, without recompiling same set of .c sources twice. Also it decouples consumers of these libs at target-level (which allows ninja to compile consumer's object files at the same time as xxx libraries)
There are huge usability problems and caveats tho) It is very difficult to use such system correctly. Maybe we could do better?
This is a rather distant goal
There should be a way to define different kinds of targets
Bonus
I would really like if we could pull off something like this example (but as a first-class citizen)
This is an example of advanced CMake, that allows to create 2 artifacts, without recompiling same set of .c sources twice. Also it decouples consumers of these libs at target-level (which allows ninja to compile consumer's object files at the same time as
xxxlibraries)There are huge usability problems and caveats tho) It is very difficult to use such system correctly. Maybe we could do better?
This is a rather distant goal