[cmake] Add function for building native tool
authorShoaib Meenai <smeenai@fb.com>
Tue, 2 Apr 2019 15:58:03 +0000 (15:58 +0000)
committerShoaib Meenai <smeenai@fb.com>
Tue, 2 Apr 2019 15:58:03 +0000 (15:58 +0000)
commitf92acf1299500b3b161a2bdf94639244a8fc4cae
tree6b8ecbe5622c8c07cbda62d688df346f9a229cb2
parentfb4d9f7287c24f16e1916afa8ea58bb8c7f856fc
[cmake] Add function for building native tool

Instead of duplicating functionality for building native versions of
tblgen and llvm-config, add a function to set up a native tool build.
This will also be used for llvm-nm in a follow-up.

This should be NFC for tblgen, besides the slightly different COMMENT
for the custom command (it'll display the tablegen target name instead
of always saying TableGen).  For the native llvm-config, it's a behavior
change in that we'll use llvm_ExternalProject_BuildCmd instead of
constructing the build command manually, always build in Release, and
reference the correct binary path for multi-config generators. I believe
all of these changes to be bug fixes.

Differential Revision: https://reviews.llvm.org/D60024

llvm-svn: 357486
llvm/cmake/modules/CrossCompile.cmake
llvm/cmake/modules/TableGen.cmake
llvm/tools/llvm-config/CMakeLists.txt