summaryrefslogtreecommitdiffstats
path: root/llvm/cmake/modules/TableGen.cmake
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2016-12-06 04:45:11 +0000
committerChris Bieneman <beanz@apple.com>2016-12-06 04:45:11 +0000
commit1b5f563a612ba1dd3142bd32623767fa03365922 (patch)
treeaf7f89b40ee1503c8db5c1035f980f7d5c29270d /llvm/cmake/modules/TableGen.cmake
parent21e53508b63c3192d293dff806b26771d100f214 (diff)
downloadbcm5719-llvm-1b5f563a612ba1dd3142bd32623767fa03365922.tar.gz
bcm5719-llvm-1b5f563a612ba1dd3142bd32623767fa03365922.zip
[CMake] Cleanup TableGen include flags
It is kinda crazy to have llvm/include and llvm/lib/Target in the include path for every tablegen invocation for every tablegen-like tool. This patch removes those flags from the tablgen function that is called everywhere by instead creating a variable LLVM_TABLEGEN_FLAGS which is setup in the LLVM source directories. This removes TableGen.cmake's dependency on LLVM_MAIN_SRC_DIR, and LLVM_MAIN_INCLUDE_DIR. llvm-svn: 288770
Diffstat (limited to 'llvm/cmake/modules/TableGen.cmake')
-rw-r--r--llvm/cmake/modules/TableGen.cmake14
1 files changed, 4 insertions, 10 deletions
diff --git a/llvm/cmake/modules/TableGen.cmake b/llvm/cmake/modules/TableGen.cmake
index a366299ab49..f966cf2d615 100644
--- a/llvm/cmake/modules/TableGen.cmake
+++ b/llvm/cmake/modules/TableGen.cmake
@@ -6,15 +6,9 @@ include(LLVMExternalProjectUtils)
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()
+ if(NOT ${project}_TABLEGEN_EXE)
+ message(FATAL_ERROR "${project}_TABLEGEN_EXE not set")
+ endif()
file(GLOB local_tds "*.td")
file(GLOB_RECURSE global_tds "${LLVM_MAIN_INCLUDE_DIR}/llvm/*.td")
@@ -28,7 +22,7 @@ function(tablegen project ofn)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
# Generate tablegen output in a temporary file.
COMMAND ${${project}_TABLEGEN_EXE} ${ARGN} -I ${CMAKE_CURRENT_SOURCE_DIR}
- -I ${LLVM_MAIN_SRC_DIR}/lib/Target -I ${LLVM_MAIN_INCLUDE_DIR}
+ ${LLVM_TABLEGEN_FLAGS}
${LLVM_TARGET_DEFINITIONS_ABSOLUTE}
-o ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
# The file in LLVM_TARGET_DEFINITIONS may be not in the current
OpenPOWER on IntegriCloud