[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 06:32:23 PST 2017


labath added inline comments.


================
Comment at: cmake/modules/CrossCompile.cmake:36
-        -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-        -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
         ${CROSS_TOOLCHAIN_FLAGS_${target_name}} ${CMAKE_SOURCE_DIR}
----------------
hintonda wrote:
> Perhaps we could just set CC and CXX:
> 
> COMMAND env CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} ${CMAKE_COMMAND}
> 
env isn't really a thing on windows. llvm tests use it, so we may be able to assume that all windows users have gnuwin32 or similar installed, but I'm still not that fond of it, as there is a difference in requiring gnuwin32 to build, vs. requiring it just for testing. (There's also the possibility to build an env command in cmake <https://cmake.org/pipermail/cmake/2011-December/048038.html> but that may be a bit too much.)

So, I am not against that, but I would prefer this solution instead (unless we can find some reason it breaks something).


https://reviews.llvm.org/D40947





More information about the llvm-commits mailing list