[PATCH] D40947: [cmake] Make setting of CMAKE_C(XX)_COMPILER flags overridable for cross-builds

Pavel Labath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 7 07:25:25 PST 2017


labath added inline comments.


================
Comment at: cmake/modules/CrossCompile.cmake:11
+    set(CROSS_TOOLCHAIN_FLAGS_INIT
+      -DCMAKE_TOOLCHAIN_FILE=\"${LLVM_MAIN_SRC_DIR}/cmake/platforms/${toolchain}.cmake\")
+  else()
----------------
hintonda wrote:
> Will the toolchain file always set the compiler?  Any way to guarantee that?
All toolchain files I've seen set the compiler (that's kinda the whole point).

I suppose one could create a toolchain file that sets all other toolchain-y variables (CMAKE_SYSROOT, CMAKE_AR, CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES, ...), but leaves the actual choice of the compiler up to the user. However, if one is dealing with a file like that, then the compilers we would specify here would probably not be correct anyway...


https://reviews.llvm.org/D40947





More information about the llvm-commits mailing list