diff --git a/CMakeLists.txt b/CMakeLists.txt index 3518a68ac52..dac209765a8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -560,6 +560,10 @@ include_directories( ${LLVM_INCLUDE_DIR} ${LLVM_MAIN_INCLUDE_DIR}) if(LLVM_USE_HOST_TOOLS) include(CrossCompile) endif(LLVM_USE_HOST_TOOLS) +if(LLVM_TARGET_IS_CROSSCOMPILE_HOST) +# Dummy use to avoid CMake Wraning: Manually-specified variables were not used +# (this is a variable that CrossCompile sets on recursive invocations) +endif() if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)") # On FreeBSD, /usr/local/* is not used by default. In order to build LLVM diff --git a/cmake/modules/CrossCompile.cmake b/cmake/modules/CrossCompile.cmake index 76a3078a544..c136dfaa612 100644 --- a/cmake/modules/CrossCompile.cmake +++ b/cmake/modules/CrossCompile.cmake @@ -19,6 +19,7 @@ function(llvm_create_cross_target_internal target_name toochain buildtype) add_custom_command(OUTPUT ${LLVM_${target_name}_BUILD}/CMakeCache.txt COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" ${CROSS_TOOLCHAIN_FLAGS_${target_name}} ${CMAKE_SOURCE_DIR} + -DLLVM_TARGET_IS_CROSSCOMPILE_HOST=TRUE WORKING_DIRECTORY ${LLVM_${target_name}_BUILD} DEPENDS ${LLVM_${target_name}_BUILD} COMMENT "Configuring ${target_name} LLVM...") @@ -43,6 +44,7 @@ function(llvm_create_cross_target_internal target_name toochain buildtype) execute_process(COMMAND ${CMAKE_COMMAND} ${build_type_flags} -G "${CMAKE_GENERATOR}" -DLLVM_TARGETS_TO_BUILD=${LLVM_TARGETS_TO_BUILD} ${CROSS_TOOLCHAIN_FLAGS_${target_name}} ${CMAKE_SOURCE_DIR} + -DLLVM_TARGET_IS_CROSSCOMPILE_HOST=TRUE WORKING_DIRECTORY ${LLVM_${target_name}_BUILD} ) endif(NOT IS_DIRECTORY ${LLVM_${target_name}_BUILD})