aboutsummaryrefslogtreecommitdiffstats
path: root/tools/llvm-config/CMakeLists.txt
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2014-12-01 14:51:49 -0800
committerStephen Hines <srhines@google.com>2014-12-02 16:08:10 -0800
commit37ed9c199ca639565f6ce88105f9e39e898d82d0 (patch)
tree8fb36d3910e3ee4c4e1b7422f4f017108efc52f5 /tools/llvm-config/CMakeLists.txt
parentd2327b22152ced7bc46dc629fc908959e8a52d03 (diff)
downloadexternal_llvm-37ed9c199ca639565f6ce88105f9e39e898d82d0.zip
external_llvm-37ed9c199ca639565f6ce88105f9e39e898d82d0.tar.gz
external_llvm-37ed9c199ca639565f6ce88105f9e39e898d82d0.tar.bz2
Update aosp/master LLVM for rebase to r222494.
Change-Id: Ic787f5e0124df789bd26f3f24680f45e678eef2d
Diffstat (limited to 'tools/llvm-config/CMakeLists.txt')
-rw-r--r--tools/llvm-config/CMakeLists.txt15
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/llvm-config/CMakeLists.txt b/tools/llvm-config/CMakeLists.txt
index 8d83762..50c84e6 100644
--- a/tools/llvm-config/CMakeLists.txt
+++ b/tools/llvm-config/CMakeLists.txt
@@ -33,3 +33,18 @@ add_llvm_tool(llvm-config
# 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)
+
+ add_custom_command(OUTPUT "${${project}_LLVM_CONFIG_EXE}"
+ 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...")
+ add_custom_target(${project}NativeLLVMConfig DEPENDS ${${project}_LLVM_CONFIG_EXE})
+ add_dependencies(${project}NativeLLVMConfig ConfigureNativeLLVM)
+
+ add_dependencies(llvm-config ${project}NativeLLVMConfig)
+endif(CMAKE_CROSSCOMPILING)