[PATCH] [docs] Add necessary CMake options for cross-compiling

He Kuang via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 30 01:33:52 PDT 2016


Mention CMAKE_{C,CXX}_COMPILER in CMake options section for
cross-compiling. If user follows the current docs without those options,
the building system will succesfully generate the wrong result by using
the host compiler. This may take extra works to find the answer from
other docs[1].

[1]: http://www.vtk.org/Wiki/CMake_Cross_Compiling#Information_how_to_set_up_various_cross_compiling_toolchains

Signed-off-by: He Kuang <hekuang at huawei.com>
---
 docs/HowToCrossCompileLLVM.rst | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/docs/HowToCrossCompileLLVM.rst b/docs/HowToCrossCompileLLVM.rst
index e71c0b0..e05fcb7 100644
--- a/docs/HowToCrossCompileLLVM.rst
+++ b/docs/HowToCrossCompileLLVM.rst
@@ -48,6 +48,11 @@ The CMake options you need to add are:
  * ``-DLLVM_TARGET_ARCH=ARM``
  * ``-DLLVM_TARGETS_TO_BUILD=ARM``
 
+And specifiy the cross-compiler to use:
+
+ * ``-DCMAKE_C_COMPILER=<c-cross-compiler>``
+ * ``-DCMAKE_CXX_COMPILER=<c++-cross-compiler>``
+
 If you're compiling with GCC, you can use architecture options for your target,
 and the compiler driver will detect everything that it needs:
 
-- 
1.8.5.2



More information about the llvm-commits mailing list