aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorOscar Fuentes <ofv@wanadoo.es>2008-11-09 18:53:19 +0000
committerOscar Fuentes <ofv@wanadoo.es>2008-11-09 18:53:19 +0000
commit3ab40ca3d507ec9d212a3ba498e0d6837634a5ad (patch)
treedaf087f18dcc1051cf371f7248aa84780d017daa /CMakeLists.txt
parent22b91d7fc47b9667453d56a23eac2b2f7afe9b57 (diff)
CMake: Support for cross-compiling. For now, requires a previously
built native tblgen which is passed to cmake in the variable LLVM_TABLEGEN. See http://www.cmake.org/Wiki/CmakeMingw for a quick example on how to cross-compile with CMake. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58939 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt9
1 files changed, 8 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4c01332772..f634503b45 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -111,10 +111,17 @@ add_subdirectory(lib/System)
# Everything else depends on Support and System:
set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} ${LLVM_LIBS} )
+set(LLVM_TABLEGEN "tblgen" CACHE
+ STRING "Native TableGen executable.")
+
+if( CMAKE_CROSSCOMPILING )
+ include( CrossCompileLLVM )
+endif( CMAKE_CROSSCOMPILING )
+
add_subdirectory(utils/TableGen)
add_custom_command(OUTPUT ${llvm_builded_incs_dir}/Intrinsics.gen
- COMMAND tblgen -gen-intrinsic -I ${LLVM_MAIN_INCLUDE_DIR} ${LLVM_MAIN_INCLUDE_DIR}/llvm/Intrinsics.td -o ${llvm_builded_incs_dir}/Intrinsics.gen
+ COMMAND ${LLVM_TABLEGEN} -gen-intrinsic -I ${LLVM_MAIN_INCLUDE_DIR} ${LLVM_MAIN_INCLUDE_DIR}/llvm/Intrinsics.td -o ${llvm_builded_incs_dir}/Intrinsics.gen
DEPENDS tblgen
COMMENT "Building intrinsics.gen...")