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
diff --git a/cmake/modules/CrossCompileLLVM.cmake b/cmake/modules/CrossCompileLLVM.cmake
new file mode 100644
index 0000000..0377c05
--- /dev/null
+++ b/cmake/modules/CrossCompileLLVM.cmake
@@ -0,0 +1,6 @@
+# TODO: Build a native tblgen when cross-compiling, if the user
+# didn't set LLVM_TABLEGEN. Then, remove this check:
+if( CMAKE_CROSSCOMPILING AND ${LLVM_TABLEGEN} STREQUAL "tblgen" )
+ message(FATAL_ERROR
+ "Set LLVM_TABLEGEN to the full route to a native tblgen executable")
+endif()