[llvm] r319228 - [cmake] Pass LLVM_USE_LINKER flag when building host tools, e.g.,
Don Hinton via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 28 13:23:30 PST 2017
Author: dhinton
Date: Tue Nov 28 13:23:30 2017
New Revision: 319228
URL: http://llvm.org/viewvc/llvm-project?rev=319228&view=rev
Log:
[cmake] Pass LLVM_USE_LINKER flag when building host tools, e.g.,
LLVM_OPTIMIZED_TABLEGEN=ON, and not crosscompiling.
Differential Revision: https://reviews.llvm.org/D39734
Modified:
llvm/trunk/cmake/modules/CrossCompile.cmake
Modified: llvm/trunk/cmake/modules/CrossCompile.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/CrossCompile.cmake?rev=319228&r1=319227&r2=319228&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/CrossCompile.cmake (original)
+++ llvm/trunk/cmake/modules/CrossCompile.cmake Tue Nov 28 13:23:30 2017
@@ -15,6 +15,9 @@ function(llvm_create_cross_target_intern
if (buildtype)
set(build_type_flags "-DCMAKE_BUILD_TYPE=${buildtype}")
endif()
+ if (LLVM_USE_LINKER AND NOT CMAKE_CROSSCOMPILING)
+ set(linker_flag "-DLLVM_USE_LINKER=${LLVM_USE_LINKER}")
+ endif()
if (LLVM_EXTERNAL_CLANG_SOURCE_DIR)
# Propagate LLVM_EXTERNAL_CLANG_SOURCE_DIR so that clang-tblgen can be built
set(external_clang_dir "-DLLVM_EXTERNAL_CLANG_SOURCE_DIR=${LLVM_EXTERNAL_CLANG_SOURCE_DIR}")
@@ -32,7 +35,7 @@ function(llvm_create_cross_target_intern
${CROSS_TOOLCHAIN_FLAGS_${target_name}} ${CMAKE_SOURCE_DIR}
-DLLVM_TARGET_IS_CROSSCOMPILE_HOST=TRUE
-DLLVM_TARGETS_TO_BUILD=${LLVM_TARGETS_TO_BUILD}
- ${build_type_flags} ${external_clang_dir}
+ ${build_type_flags} ${linker_flag} ${external_clang_dir}
WORKING_DIRECTORY ${LLVM_${target_name}_BUILD}
DEPENDS CREATE_LLVM_${target_name}
COMMENT "Configuring ${target_name} LLVM...")
More information about the llvm-commits
mailing list