aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt2
-rw-r--r--cmake/modules/TableGen.cmake4
2 files changed, 4 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 08008f9f227..f209338e2c1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -803,8 +803,6 @@ endif()
include(AddLLVM)
include(TableGen)
-set(LLVM_TABLEGEN_FLAGS -I ${LLVM_MAIN_INCLUDE_DIR})
-
if( MINGW )
# People report that -O3 is unreliable on MinGW. The traditional
# build also uses -O2 for that reason:
diff --git a/cmake/modules/TableGen.cmake b/cmake/modules/TableGen.cmake
index f966cf2d615..9682002c2ab 100644
--- a/cmake/modules/TableGen.cmake
+++ b/cmake/modules/TableGen.cmake
@@ -4,6 +4,10 @@
include(LLVMExternalProjectUtils)
+if(LLVM_MAIN_INCLUDE_DIR)
+ set(LLVM_TABLEGEN_FLAGS -I ${LLVM_MAIN_INCLUDE_DIR})
+endif()
+
function(tablegen project ofn)
# Validate calling context.
if(NOT ${project}_TABLEGEN_EXE)