summaryrefslogtreecommitdiffstats
path: root/llvm/cmake/modules
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2015-10-09 22:26:04 +0000
committerChris Bieneman <beanz@apple.com>2015-10-09 22:26:04 +0000
commit8a3e6e19af7188518db18574168875546f25ba3d (patch)
tree5cdca3a7aa0d28811813c94920b7edadfc7943ba /llvm/cmake/modules
parent35d27b21a1947c1f62359be26a5f2da98ab11967 (diff)
downloadbcm5719-llvm-8a3e6e19af7188518db18574168875546f25ba3d.tar.gz
bcm5719-llvm-8a3e6e19af7188518db18574168875546f25ba3d.zip
[CMake] Parallel make breaks on native tablegen
Patch by Alex Wang This patch resolves a parallelization issue that occurs when native tablegen targets are built at the same time. They both try to build libSupport and clobber each other causing the builds to fail. llvm-svn: 249911
Diffstat (limited to 'llvm/cmake/modules')
-rw-r--r--llvm/cmake/modules/TableGen.cmake11
1 files changed, 10 insertions, 1 deletions
diff --git a/llvm/cmake/modules/TableGen.cmake b/llvm/cmake/modules/TableGen.cmake
index 452a728db4f..cb06450959a 100644
--- a/llvm/cmake/modules/TableGen.cmake
+++ b/llvm/cmake/modules/TableGen.cmake
@@ -70,6 +70,15 @@ function(add_public_tablegen_target target)
set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} ${target} PARENT_SCOPE)
endfunction()
+if(LLVM_USE_HOST_TOOLS)
+ add_custom_command(OUTPUT LIB_LLVMSUPPORT
+ COMMAND ${CMAKE_COMMAND} --build . --target LLVMSupport --config Release
+ DEPENDS CONFIGURE_LLVM_NATIVE
+ WORKING_DIRECTORY ${LLVM_NATIVE_BUILD}
+ COMMENT "Building libLLVMSupport for native TableGen...")
+ add_custom_target(NATIVE_LIB_LLVMSUPPORT DEPENDS LIB_LLVMSUPPORT)
+endif(LLVM_USE_HOST_TOOLS)
+
macro(add_tablegen target project)
set(${target}_OLD_LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS})
set(LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS} TableGen)
@@ -109,7 +118,7 @@ macro(add_tablegen target project)
add_custom_command(OUTPUT ${${project}_TABLEGEN_EXE}
COMMAND ${CMAKE_COMMAND} --build . --target ${target} --config Release
- DEPENDS CONFIGURE_LLVM_NATIVE ${target}
+ DEPENDS ${target} NATIVE_LIB_LLVMSUPPORT
WORKING_DIRECTORY ${LLVM_NATIVE_BUILD}
COMMENT "Building native TableGen...")
add_custom_target(${project}-tablegen-host DEPENDS ${${project}_TABLEGEN_EXE})
OpenPOWER on IntegriCloud