Skip to content

Commit

Permalink
Re-land "Fix MSVC dependency issue between Clang-tablegen and LLVM-ta…
Browse files Browse the repository at this point in the history
…blegen"

Previously, when compiling Visual Studio targets, one could see random build errors. This was caused by tablegen projects using the same build folders.
This workaround simply chains tablegen projects.

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

llvm-svn: 349596
  • Loading branch information
aganea committed Dec 19, 2018
1 parent 894385d commit 405810c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions llvm/cmake/modules/TableGen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ macro(add_tablegen target project)
llvm_ExternalProject_BuildCmd(tblgen_build_cmd ${target}
${LLVM_NATIVE_BUILD}
CONFIGURATION Release)
# Create an artificial dependency between tablegen projects, because they
# compile the same dependencies, thus using the same build folders.
# FIXME: A proper fix requires sequentially chaining tablegens.
if (NOT ${project} STREQUAL LLVM AND TARGET ${project}-tablegen-host)
add_dependencies(${project}-tablegen-host LLVM-tablegen-host)
endif()
add_custom_command(OUTPUT ${${project}_TABLEGEN_EXE}
COMMAND ${tblgen_build_cmd}
DEPENDS CONFIGURE_LLVM_NATIVE ${target}
Expand Down

0 comments on commit 405810c

Please sign in to comment.