I have a project in language A with most toolchain files also in A.
If built with unittests then there is one or two subdirectories in language B included.
One single toolchain is also in language B.
Depending on an option set there might also be some files in language C included which require a locally scoped enabling of language C…
How do I set enable_language so that A is enabled everywhere whereas B is only enabled in the unittest subdirectory and/or for the particular toolchain (preferably without having an ugly if(unittests OR my_special_toolchain) clause)?
I particularly want to avoid having to specify language B compilers for toolchains that do not use it which seems to be the case when all three are defined on the project command.
I have tried a bit with only setting A on the project command and adding the others as need arise but I’d love some guidance on best practices/pitfalls to avoid.