TableGen.cmake: sometimes the .td file is not in the current directory
authorOscar Fuentes <ofv@wanadoo.es>
Mon, 3 Jan 2011 20:01:32 +0000 (20:01 +0000)
committerOscar Fuentes <ofv@wanadoo.es>
Mon, 3 Jan 2011 20:01:32 +0000 (20:01 +0000)
(clang/include/clang/Basic/StmtNodes.td, for instance, is tablegenned
from clang/include/clang/AST/CMakeLists.txt) so it is not contained on
the list of all .td files on the current source directory which is
used as the DEPENDS of the custom command. We must add the .td file to
the DEPENDS list of the custom command. Otherwise some .inc files are
not regenerated when the corresponding .td file changes.

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

cmake/modules/TableGen.cmake

index e61a3427cc2e122cc00d8b0dd1f76ff7fbdd4bbd..c1a11b3426196d754e24c01e4434e4e26611d10e 100644 (file)
@@ -18,7 +18,10 @@ macro(tablegen ofn)
     -I ${LLVM_MAIN_SRC_DIR}/lib/Target -I ${LLVM_MAIN_INCLUDE_DIR}
     ${LLVM_TARGET_DEFINITIONS_ABSOLUTE} 
     -o ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
-    DEPENDS tblgen ${local_tds} ${global_tds}
+    # The file in LLVM_TARGET_DEFINITIONS may be not in the current
+    # directory and local_tds may not contain it, so we must
+    # explicitly list it here:
+    DEPENDS tblgen ${local_tds} ${global_tds} ${LLVM_TARGET_DEFINITIONS_ABSOLUTE}
     COMMENT "Building ${ofn}..."
     )
   add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}