]> granicus.if.org Git - llvm/commitdiff
Re-land "Fix MSVC dependency issue between Clang-tablegen and LLVM-tablegen"
authorAlexandre Ganea <alexandre.ganea@ubisoft.com>
Wed, 19 Dec 2018 01:30:29 +0000 (01:30 +0000)
committerAlexandre Ganea <alexandre.ganea@ubisoft.com>
Wed, 19 Dec 2018 01:30:29 +0000 (01:30 +0000)
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

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

cmake/modules/TableGen.cmake

index d1afcb42f9de7de87e421fb8b5265e2e25e39372..2d942435222ee472d75b4e535c147ae4510e255b 100644 (file)
@@ -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}