[llvm] r349541 - Fix MSVC dependency issue between Clang-tablegen and LLVM-tablegen

Alexandre Ganea via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 18 13:03:06 PST 2018


Author: aganea
Date: Tue Dec 18 13:03:06 2018
New Revision: 349541

URL: http://llvm.org/viewvc/llvm-project?rev=349541&view=rev
Log:
Fix MSVC dependency issue between Clang-tablegen and LLVM-tablegen

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

Modified:
    llvm/trunk/cmake/modules/TableGen.cmake

Modified: llvm/trunk/cmake/modules/TableGen.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/TableGen.cmake?rev=349541&r1=349540&r2=349541&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/TableGen.cmake (original)
+++ llvm/trunk/cmake/modules/TableGen.cmake Tue Dec 18 13:03:06 2018
@@ -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)
+        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}




More information about the llvm-commits mailing list