I think the simplest thing would require completely rearchitecting llbuild/SPM because the build model doesn't allow for n-parallel builds (with different flags) of each target, and the SPM manifest as well as that does not explicitly state the type of linkage per target. The object files must be separated so the contents of .build
need to be restructured as well. That is to say, we need to change to a model as the following:
.target("a", type: .dynamic_library, dependencies: [
.target("b", linkage: .static),
.target("c", linkage: .dynamic),
]),
.target("b", type: .dynamic_library),
.target("c", type: .static_library),
.target("d", type: .static_executable),
.target("e", type: .dynamic_executable),
Note that the target linkage and types are mismatched, and that this builds at least 8 targets (with only 5 targets defined).
Perhaps @bnbarham and @Max_Desiatov can chime in if that is feasible to do in the short term.