diff options
| author | NAKAMURA Takumi <geek4civic@gmail.com> | 2014-02-12 11:50:11 +0000 |
|---|---|---|
| committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2014-02-12 11:50:11 +0000 |
| commit | 04817e49bce9b7f46aa29aea96239ded3839660f (patch) | |
| tree | cc57fd2c2fd06d9c2e6040c12c787fc2f638d58f /llvm/cmake/modules | |
| parent | 9218e947142069af4c567b55d895209681e3066d (diff) | |
| download | bcm5719-llvm-04817e49bce9b7f46aa29aea96239ded3839660f.tar.gz bcm5719-llvm-04817e49bce9b7f46aa29aea96239ded3839660f.zip | |
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.
llvm-svn: 201229
Diffstat (limited to 'llvm/cmake/modules')
| -rw-r--r-- | llvm/cmake/modules/TableGen.cmake | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/cmake/modules/TableGen.cmake b/llvm/cmake/modules/TableGen.cmake index 6e52e4d5341..fdb47511dcc 100644 --- a/llvm/cmake/modules/TableGen.cmake +++ b/llvm/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") |

