[CMake] Flag recursive cmake invocations for cross-compile
authorJoseph Tremoulet <jotrem@microsoft.com>
Wed, 9 Sep 2015 14:57:06 +0000 (14:57 +0000)
committerJoseph Tremoulet <jotrem@microsoft.com>
Wed, 9 Sep 2015 14:57:06 +0000 (14:57 +0000)
commit22c3d9db50721e183294287f2edafc1f4b2c1034
tree78d76f6c728747fdbfc79718e3fa7123270901d5
parent4cb9c6ade04ff9c26c3464d07719fafcb85eae8a
[CMake] Flag recursive cmake invocations for cross-compile

Summary:
Cross-compilation uses recursive cmake invocations to build native host
tools.  These recursive invocations only forward a fixed set of
variables/options, since the native environment is generally the default.
This change adds -DLLVM_TARGET_IS_CROSSCOMPILE_HOST=TRUE to the recursive
cmake invocations, so that cmake files can distinguish these recursive
invocations from top-level ones, which can explain why expected options
are unset.

LLILC will use this to avoid trying to generate its build rules in the
crosscompile native host target (where it is not needed), which would fail
if attempted because LLILC requires a cmake variable passed on the command
line, which is not forwarded in the recursive invocation.

Reviewers: rnk, beanz

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D12679

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247151 91177308-0d34-0410-b5e6-96231b3b80d8
CMakeLists.txt
cmake/modules/CrossCompile.cmake