If Ninja Multi-Config is used and LLVM_OPTIMIZED_TABLEGEN=YES is set
tablegen binaries will be built in Release, even when building for Debug configuration,
without needing a separate configured build directory just for tablegen binaries.
To get such a setup you'd configure like this:
cmake -G 'Ninja Multi-Config' /path/to/llvm-project/llvm \ -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DCMAKE_CROSS_CONFIGS="Release" \ -DLLVM_OPTIMIZED_TABLEGEN=YES \ ....
Also note the other benefit of Ninja Multi-Config is saving configure time, particularly when
switching between Debug and Release during development.
This can actually break the dependency tracking; I think that we should figure out how to get the target setup and use that. At that point, rather than computing the path manually, we should be able to use the generator expression $<TARGET_FILE:target> to get the path.