[PATCH] D41806: [cmake] Don't build Native LLVM_CONFIG_EXE when cross compiling if passed by user.
Don Hinton via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 19 13:22:25 PST 2018
hintonda updated this revision to Diff 130681.
hintonda added a comment.
- Change name to LLVM_CONFIG_PATH per suggestion by @phosek.
Repository:
rL LLVM
https://reviews.llvm.org/D41806
Files:
cmake/modules/LLVMExternalProjectUtils.cmake
tools/llvm-config/CMakeLists.txt
Index: tools/llvm-config/CMakeLists.txt
===================================================================
--- tools/llvm-config/CMakeLists.txt
+++ tools/llvm-config/CMakeLists.txt
@@ -64,18 +64,18 @@
# 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")
+ set(LLVM_CONFIG_PATH ${LLVM_CONFIG_PATH} PARENT_SCOPE)
- 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()
Index: cmake/modules/LLVMExternalProjectUtils.cmake
===================================================================
--- cmake/modules/LLVMExternalProjectUtils.cmake
+++ cmake/modules/LLVMExternalProjectUtils.cmake
@@ -141,7 +141,7 @@
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_AR=${CMAKE_AR}
-DCMAKE_RANLIB=${CMAKE_RANLIB})
- set(llvm_config_path "${LLVM_NATIVE_BUILD}/bin/llvm-config")
+ set(llvm_config_path ${LLVM_CONFIG_PATH})
else()
set(llvm_config_path "$<TARGET_FILE:llvm-config>")
endif()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41806.130681.patch
Type: text/x-patch
Size: 2084 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180119/4403cf2a/attachment.bin>
More information about the llvm-commits
mailing list