summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2013-08-24 00:20:36 +0000
committerHans Wennborg <hans@hanshq.net>2013-08-24 00:20:36 +0000
commit2982c08884a30e868f74b8824b5b456a3cb544c9 (patch)
tree14fe0bc57a6775b13bab7a91ad959fba90716766 /cmake
parentcb1339ebeb40974fa521e8b78c779a1e846aaf5f (diff)
downloadexternal_llvm-2982c08884a30e868f74b8824b5b456a3cb544c9.zip
external_llvm-2982c08884a30e868f74b8824b5b456a3cb544c9.tar.gz
external_llvm-2982c08884a30e868f74b8824b5b456a3cb544c9.tar.bz2
CMake: Add LLVM_INSTALL_TOOLCHAIN_ONLY option.
Differential Revision: http://llvm-reviews.chandlerc.com/D1428 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189155 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/AddLLVM.cmake29
-rw-r--r--cmake/modules/CMakeLists.txt32
2 files changed, 38 insertions, 23 deletions
diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake
index 277914f..472ecef 100644
--- a/cmake/modules/AddLLVM.cmake
+++ b/cmake/modules/AddLLVM.cmake
@@ -26,9 +26,11 @@ macro(add_llvm_library name)
if( EXCLUDE_FROM_ALL )
set_target_properties( ${name} PROPERTIES EXCLUDE_FROM_ALL ON)
else()
- install(TARGETS ${name}
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
+ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "LTO")
+ install(TARGETS ${name}
+ LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
+ ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
+ endif()
endif()
set_target_properties(${name} PROPERTIES FOLDER "Libraries")
@@ -70,9 +72,11 @@ ${name} ignored.")
if( EXCLUDE_FROM_ALL )
set_target_properties( ${name} PROPERTIES EXCLUDE_FROM_ALL ON)
else()
- install(TARGETS ${name}
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
+ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
+ install(TARGETS ${name}
+ LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
+ ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
+ endif()
endif()
endif()
@@ -96,14 +100,23 @@ macro(add_llvm_executable name)
endmacro(add_llvm_executable name)
+set (LLVM_TOOLCHAIN_TOOLS
+ llvm-ar
+ llvm-objdump
+ )
+
macro(add_llvm_tool name)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_TOOLS_BINARY_DIR})
if( NOT LLVM_BUILD_TOOLS )
set(EXCLUDE_FROM_ALL ON)
endif()
add_llvm_executable(${name} ${ARGN})
- if( LLVM_BUILD_TOOLS )
- install(TARGETS ${name} RUNTIME DESTINATION bin)
+
+ list(FIND LLVM_TOOLCHAIN_TOOLS ${name} LLVM_IS_${name}_TOOLCHAIN_TOOL)
+ if (LLVM_IS_${name}_TOOLCHAIN_TOOL GREATER -1 OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
+ if( LLVM_BUILD_TOOLS )
+ install(TARGETS ${name} RUNTIME DESTINATION bin)
+ endif()
endif()
set_target_properties(${name} PROPERTIES FOLDER "Tools")
endmacro(add_llvm_tool name)
diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt
index f51e9af..0253952 100644
--- a/cmake/modules/CMakeLists.txt
+++ b/cmake/modules/CMakeLists.txt
@@ -19,19 +19,21 @@ configure_file(
${llvm_cmake_builddir}/LLVMConfigVersion.cmake
@ONLY)
-install(FILES
- ${llvm_cmake_builddir}/LLVMConfig.cmake
- ${llvm_cmake_builddir}/LLVMConfigVersion.cmake
- LLVM-Config.cmake
- DESTINATION share/llvm/cmake)
+if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
+ install(FILES
+ ${llvm_cmake_builddir}/LLVMConfig.cmake
+ ${llvm_cmake_builddir}/LLVMConfigVersion.cmake
+ LLVM-Config.cmake
+ DESTINATION share/llvm/cmake)
-install(DIRECTORY .
- DESTINATION share/llvm/cmake
- FILES_MATCHING PATTERN *.cmake
- PATTERN .svn EXCLUDE
- PATTERN LLVMConfig.cmake EXCLUDE
- PATTERN LLVMConfigVersion.cmake EXCLUDE
- PATTERN LLVM-Config.cmake EXCLUDE
- PATTERN GetHostTriple.cmake EXCLUDE
- PATTERN VersionFromVCS.cmake EXCLUDE
- PATTERN CheckAtomic.cmake EXCLUDE)
+ install(DIRECTORY .
+ DESTINATION share/llvm/cmake
+ FILES_MATCHING PATTERN *.cmake
+ PATTERN .svn EXCLUDE
+ PATTERN LLVMConfig.cmake EXCLUDE
+ PATTERN LLVMConfigVersion.cmake EXCLUDE
+ PATTERN LLVM-Config.cmake EXCLUDE
+ PATTERN GetHostTriple.cmake EXCLUDE
+ PATTERN VersionFromVCS.cmake EXCLUDE
+ PATTERN CheckAtomic.cmake EXCLUDE)
+endif()