]> granicus.if.org Git - llvm/commitdiff
[CMake] Allow TableGen.cmake to be included multiple times
authorChris Bieneman <beanz@apple.com>
Tue, 25 Jul 2017 20:53:31 +0000 (20:53 +0000)
committerChris Bieneman <beanz@apple.com>
Tue, 25 Jul 2017 20:53:31 +0000 (20:53 +0000)
This patch allows TableGen.cmake to be safely included multiple times in sub-projects.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309029 91177308-0d34-0410-b5e6-96231b3b80d8

cmake/modules/TableGen.cmake

index 8c3e2d7d700473af28112f27d2fdb6743c8ce47b..8ee7f97099196d77d1282e9cca7aa3305712f6d4 100644 (file)
@@ -110,7 +110,7 @@ function(add_public_tablegen_target target)
   set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} ${target} PARENT_SCOPE)
 endfunction()
 
-if(LLVM_USE_HOST_TOOLS)
+if(LLVM_USE_HOST_TOOLS AND NOT TARGET NATIVE_LIB_LLVMTABLEGEN)
   llvm_ExternalProject_BuildCmd(tblgen_build_cmd LLVMSupport
     ${LLVM_NATIVE_BUILD}
     CONFIGURATION Release)