summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2014-02-12 11:50:11 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2014-02-12 11:50:11 +0000
commitdd5ff1bf41e1286fe230c1201ef81579767801bc (patch)
tree33db5571e9c01dcba01d06cbb2df64af3eaa649e /cmake
parenteee40f92a9094f77514a417a3c727fb24e19bf96 (diff)
downloadllvm-dd5ff1bf41e1286fe230c1201ef81579767801bc.tar.gz
llvm-dd5ff1bf41e1286fe230c1201ef81579767801bc.tar.bz2
llvm-dd5ff1bf41e1286fe230c1201ef81579767801bc.tar.xz
Teach tablegen() macro to check needed variables
This macro depends on several variables to be set in the calling context. Check them and report an error if they are not set. Without this, custom commands may be silently specified that will fail at build time. Patch by Brad King. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201229 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/TableGen.cmake11
1 files changed, 11 insertions, 0 deletions
diff --git a/cmake/modules/TableGen.cmake b/cmake/modules/TableGen.cmake
index 6e52e4d534..fdb47511dc 100644
--- a/cmake/modules/TableGen.cmake
+++ b/cmake/modules/TableGen.cmake
@@ -3,6 +3,17 @@
# Adds the name of the generated file to TABLEGEN_OUTPUT.
function(tablegen project ofn)
+ # Validate calling context.
+ foreach(v
+ ${project}_TABLEGEN_EXE
+ LLVM_MAIN_SRC_DIR
+ LLVM_MAIN_INCLUDE_DIR
+ )
+ if(NOT ${v})
+ message(FATAL_ERROR "${v} not set")
+ endif()
+ endforeach()
+
file(GLOB local_tds "*.td")
file(GLOB_RECURSE global_tds "${LLVM_MAIN_INCLUDE_DIR}/llvm/*.td")