
On Apr 24, 2016, at 6:43 PM, Rob Stewart <rstewart@ptd.net> wrote:
On April 23, 2016 1:19:08 PM EDT, Paul Fultz II <pfultz2@yahoo.com> wrote:
On Apr 23, 2016, at 9:30 AM, Raffi Enficiaud <raffi.enficiaud@mines-paris.org> wrote:
Let me (try to) explain my point with an "analogy" with templates vs overloads:
What cmake can do is: -------- declare possibly N combinations targetA(variant1, compilation_options1); targetA(variant1, compilation_optionsM); ... targetA(variantN, compilation_optionM); --------
and then consume a subset of the declared combination:
-------- targetA(variantX, compilation_optionsY); -------- with 1<= X <= N, 1 <= Y <= M.
-------- What BJam can do is:
-------- template <class variants, class compilation_options> targetA(variants, compilation_options);
-------- and then consume any: targetA(variantX, compilation_optionsY); --------
with the same flexibility as templates: the instance of generating a version of targetA is defined at the point it is consumed.
I do not follow this analogy at all.
With CMake, you often have to add special cases and conditional logic to account for variations that might be chosen,
Most variations such as shared/static or debug/release are already supported by cmake, so the build script usually doesn’t need conditional logic. However,
those variations have to be chosen in separate invocations, if not in separate build trees.
Yes that is generally true, although I don’t consider it very problematic.