From d334a86a9fbd589d23cd3ee00c5729f477158989 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Fri, 23 Oct 2015 19:48:17 +0000 Subject: [PATCH] [CMake] Fixing dependency issue with parallel make when building with LLVM_OPTIMIZED_TABLEGEN. Patch by Alex Wang git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251138 91177308-0d34-0410-b5e6-96231b3b80d8 --- cmake/modules/TableGen.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cmake/modules/TableGen.cmake b/cmake/modules/TableGen.cmake index cb06450959a..fca7d1bda4b 100644 --- a/cmake/modules/TableGen.cmake +++ b/cmake/modules/TableGen.cmake @@ -77,6 +77,13 @@ if(LLVM_USE_HOST_TOOLS) WORKING_DIRECTORY ${LLVM_NATIVE_BUILD} COMMENT "Building libLLVMSupport for native TableGen...") add_custom_target(NATIVE_LIB_LLVMSUPPORT DEPENDS LIB_LLVMSUPPORT) + + add_custom_command(OUTPUT LIB_LLVMTABLEGEN + COMMAND ${CMAKE_COMMAND} --build . --target LLVMTableGen --config Release + DEPENDS CONFIGURE_LLVM_NATIVE + WORKING_DIRECTORY ${LLVM_NATIVE_BUILD} + COMMENT "Building libLLVMTableGen for native TableGen...") + add_custom_target(NATIVE_LIB_LLVMTABLEGEN DEPENDS LIB_LLVMTABLEGEN) endif(LLVM_USE_HOST_TOOLS) macro(add_tablegen target project) @@ -118,7 +125,7 @@ macro(add_tablegen target project) add_custom_command(OUTPUT ${${project}_TABLEGEN_EXE} COMMAND ${CMAKE_COMMAND} --build . --target ${target} --config Release - DEPENDS ${target} NATIVE_LIB_LLVMSUPPORT + DEPENDS ${target} NATIVE_LIB_LLVMSUPPORT NATIVE_LIB_LLVMTABLEGEN WORKING_DIRECTORY ${LLVM_NATIVE_BUILD} COMMENT "Building native TableGen...") add_custom_target(${project}-tablegen-host DEPENDS ${${project}_TABLEGEN_EXE}) -- 2.34.1