[CMake] Cleanup LLVM_OPTIMIZED_TABLEGEN
authorChris Bieneman <beanz@apple.com>
Tue, 6 Sep 2016 20:27:07 +0000 (20:27 +0000)
committerChris Bieneman <beanz@apple.com>
Tue, 6 Sep 2016 20:27:07 +0000 (20:27 +0000)
commit76864f9c7749cd401e85fa2ed8301292fe629f03
tree07381fe79caccf2ce62be6d3a83c03b2306800b4
parent1d65026ca6844f7401e3aa4a9f3f0d3e1ed9f406
[CMake] Cleanup LLVM_OPTIMIZED_TABLEGEN

This cleanup removes the need for the native support library to have its own target. That target was only needed because makefile builds were tripping over each other if two tablegen targets were building at the same time. This causes problems because the parallel make invocations through CMake can't communicate with each other. This is fixed by invoking make directly instead of through CMake which is how we handle this in External Project invocations.

The other part of the cleanup is to mark the custom commands as USES_TERMINAL. This is a bit of a hack, but we need to ensure that Ninja generators don't invoke multiple tablegen targets in the same build dir in parallel, because that too would be bad.

Marking as USES_TERMINAL does have some downside for Ninja because it results in decreased parallelism, but correct builds are worth the minor loss and LLVM_OPTIMZIED_TABLEGEN is such a huge win, it is worth it.

llvm-svn: 280748
llvm/cmake/modules/LLVMExternalProjectUtils.cmake
llvm/cmake/modules/TableGen.cmake