llvm.org GIT mirror llvm / 133e52e
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 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_60@332568 91177308-0d34-0410-b5e6-96231b3b80d8 Tom Stellard 1 year, 5 months ago
1 changed file(s) with 7 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
6464 # Add the dependency on the generation step.
6565 add_file_dependencies(${CMAKE_CURRENT_SOURCE_DIR}/llvm-config.cpp ${BUILDVARIABLES_OBJPATH})
6666
67 if(CMAKE_CROSSCOMPILING)
68 set(${project}_LLVM_CONFIG_EXE "${LLVM_NATIVE_BUILD}/bin/llvm-config")
69 set(${project}_LLVM_CONFIG_EXE ${${project}_LLVM_CONFIG_EXE} PARENT_SCOPE)
67 if(CMAKE_CROSSCOMPILING AND NOT LLVM_CONFIG_PATH)
68 set(LLVM_CONFIG_PATH "${LLVM_NATIVE_BUILD}/bin/llvm-config" CACHE STRING "")
7069
71 add_custom_command(OUTPUT "${${project}_LLVM_CONFIG_EXE}"
70 add_custom_command(OUTPUT "${LLVM_CONFIG_PATH}"
7271 COMMAND ${CMAKE_COMMAND} --build . --target llvm-config --config $
7372 DEPENDS ${LLVM_NATIVE_BUILD}/CMakeCache.txt
7473 WORKING_DIRECTORY ${LLVM_NATIVE_BUILD}
7574 COMMENT "Building native llvm-config..."
7675 USES_TERMINAL)
77 add_custom_target(${project}NativeLLVMConfig DEPENDS ${${project}_LLVM_CONFIG_EXE})
78 add_dependencies(${project}NativeLLVMConfig CONFIGURE_LLVM_NATIVE)
76 add_custom_target(NativeLLVMConfig DEPENDS ${LLVM_CONFIG_PATH})
77 add_dependencies(NativeLLVMConfig CONFIGURE_LLVM_NATIVE)
7978
80 add_dependencies(llvm-config ${project}NativeLLVMConfig)
81 endif(CMAKE_CROSSCOMPILING)
79 add_dependencies(llvm-config NativeLLVMConfig)
80 endif()