[llvm-branch-commits] [llvm-branch] r332568 - Merging r323053:
Tom Stellard via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed May 16 20:11:36 PDT 2018
Author: tstellar
Date: Wed May 16 20:11:35 2018
New Revision: 332568
URL: http://llvm.org/viewvc/llvm-project?rev=332568&view=rev
Log:
Merging r323053:
------------------------------------------------------------------------
r323053 | dhinton | 2018-01-20 16:29:00 -0800 (Sat, 20 Jan 2018) | 9 lines
[cmake] Don't build Native llvm-config when cross compiling if passed by user.
Summary:
Rename LLVM_CONFIG_EXE to LLVM_CONFIG_PATH, and avoid building it if
passed in by user. This is the same way CLANG_TABLEGEN and
LLVM_TABLEGEN are handled, e.g., when -DLLVM_OPTIMIZED_TABLEGEN=ON is
passed.
Differential Revision: https://reviews.llvm.org/D41806
------------------------------------------------------------------------
Modified:
llvm/branches/release_60/tools/llvm-config/CMakeLists.txt
Modified: llvm/branches/release_60/tools/llvm-config/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_60/tools/llvm-config/CMakeLists.txt?rev=332568&r1=332567&r2=332568&view=diff
==============================================================================
--- llvm/branches/release_60/tools/llvm-config/CMakeLists.txt (original)
+++ llvm/branches/release_60/tools/llvm-config/CMakeLists.txt Wed May 16 20:11:35 2018
@@ -65,18 +65,17 @@ endif()
# Add the dependency on the generation step.
add_file_dependencies(${CMAKE_CURRENT_SOURCE_DIR}/llvm-config.cpp ${BUILDVARIABLES_OBJPATH})
-if(CMAKE_CROSSCOMPILING)
- set(${project}_LLVM_CONFIG_EXE "${LLVM_NATIVE_BUILD}/bin/llvm-config")
- set(${project}_LLVM_CONFIG_EXE ${${project}_LLVM_CONFIG_EXE} PARENT_SCOPE)
+if(CMAKE_CROSSCOMPILING AND NOT LLVM_CONFIG_PATH)
+ set(LLVM_CONFIG_PATH "${LLVM_NATIVE_BUILD}/bin/llvm-config" CACHE STRING "")
- add_custom_command(OUTPUT "${${project}_LLVM_CONFIG_EXE}"
+ add_custom_command(OUTPUT "${LLVM_CONFIG_PATH}"
COMMAND ${CMAKE_COMMAND} --build . --target llvm-config --config $<CONFIGURATION>
DEPENDS ${LLVM_NATIVE_BUILD}/CMakeCache.txt
WORKING_DIRECTORY ${LLVM_NATIVE_BUILD}
COMMENT "Building native llvm-config..."
USES_TERMINAL)
- add_custom_target(${project}NativeLLVMConfig DEPENDS ${${project}_LLVM_CONFIG_EXE})
- add_dependencies(${project}NativeLLVMConfig CONFIGURE_LLVM_NATIVE)
+ add_custom_target(NativeLLVMConfig DEPENDS ${LLVM_CONFIG_PATH})
+ add_dependencies(NativeLLVMConfig CONFIGURE_LLVM_NATIVE)
- add_dependencies(llvm-config ${project}NativeLLVMConfig)
-endif(CMAKE_CROSSCOMPILING)
+ add_dependencies(llvm-config NativeLLVMConfig)
+endif()
More information about the llvm-branch-commits
mailing list