OSDN Git Service

[cmake] Pass CMAKE_MAKE_PROGRAM to native configure
authorShoaib Meenai <smeenai@fb.com>
Mon, 8 Jan 2018 21:52:58 +0000 (21:52 +0000)
committerShoaib Meenai <smeenai@fb.com>
Mon, 8 Jan 2018 21:52:58 +0000 (21:52 +0000)
If the make program isn't in the path, the native configure will fail.
Pass CMAKE_MAKE_PROGRAM to the native configure explicitly to remedy
this, similar to what's already done for external project configuration.
Explicitly set CMAKE_MAKE_PROGRAM before the user flags so that they can
override it for the native build if they desire (though I can't fathom
why that would be useful).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322032 91177308-0d34-0410-b5e6-96231b3b80d8

cmake/modules/CrossCompile.cmake

index 0ec76ea..c0c06c8 100644 (file)
@@ -45,6 +45,7 @@ function(llvm_create_cross_target_internal target_name toolchain buildtype)
 
   add_custom_command(OUTPUT ${LLVM_${target_name}_BUILD}/CMakeCache.txt
     COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}"
+        -DCMAKE_MAKE_PROGRAM="${CMAKE_MAKE_PROGRAM}"
         ${CROSS_TOOLCHAIN_FLAGS_${target_name}} ${CMAKE_SOURCE_DIR}
         -DLLVM_TARGET_IS_CROSSCOMPILE_HOST=TRUE
         -DLLVM_TARGETS_TO_BUILD="${targets_to_build_arg}"