mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
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
This commit is contained in:
parent
cb1339ebeb
commit
2982c08884
@ -15,6 +15,8 @@ set(LLVM_VERSION_MINOR 4)
|
|||||||
|
|
||||||
set(PACKAGE_VERSION "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}svn")
|
set(PACKAGE_VERSION "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}svn")
|
||||||
|
|
||||||
|
option(LLVM_INSTALL_TOOLCHAIN_ONLY "Only include toolchain files in the 'install' target." OFF)
|
||||||
|
|
||||||
option(LLVM_USE_FOLDERS "Enable solution folders in Visual Studio. Disable for Express versions." ON)
|
option(LLVM_USE_FOLDERS "Enable solution folders in Visual Studio. Disable for Express versions." ON)
|
||||||
if ( LLVM_USE_FOLDERS )
|
if ( LLVM_USE_FOLDERS )
|
||||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||||
@ -465,28 +467,35 @@ endif()
|
|||||||
|
|
||||||
add_subdirectory(cmake/modules)
|
add_subdirectory(cmake/modules)
|
||||||
|
|
||||||
install(DIRECTORY include/
|
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
|
||||||
DESTINATION include
|
install(DIRECTORY include/
|
||||||
FILES_MATCHING
|
DESTINATION include
|
||||||
PATTERN "*.def"
|
FILES_MATCHING
|
||||||
PATTERN "*.h"
|
PATTERN "*.def"
|
||||||
PATTERN "*.td"
|
PATTERN "*.h"
|
||||||
PATTERN "*.inc"
|
PATTERN "*.td"
|
||||||
PATTERN "LICENSE.TXT"
|
PATTERN "*.inc"
|
||||||
PATTERN ".svn" EXCLUDE
|
PATTERN "LICENSE.TXT"
|
||||||
)
|
PATTERN ".svn" EXCLUDE
|
||||||
|
)
|
||||||
|
|
||||||
|
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/
|
||||||
|
DESTINATION include
|
||||||
|
FILES_MATCHING
|
||||||
|
PATTERN "*.def"
|
||||||
|
PATTERN "*.h"
|
||||||
|
PATTERN "*.gen"
|
||||||
|
PATTERN "*.inc"
|
||||||
|
# Exclude include/llvm/CMakeFiles/intrinsics_gen.dir, matched by "*.def"
|
||||||
|
PATTERN "CMakeFiles" EXCLUDE
|
||||||
|
PATTERN ".svn" EXCLUDE
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if( NOT WIN32 )
|
||||||
|
install(FILES include/llvm-c/lto.h DESTINATION include/llvm-c)
|
||||||
|
endif()
|
||||||
|
|
||||||
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/
|
|
||||||
DESTINATION include
|
|
||||||
FILES_MATCHING
|
|
||||||
PATTERN "*.def"
|
|
||||||
PATTERN "*.h"
|
|
||||||
PATTERN "*.gen"
|
|
||||||
PATTERN "*.inc"
|
|
||||||
# Exclude include/llvm/CMakeFiles/intrinsics_gen.dir, matched by "*.def"
|
|
||||||
PATTERN "CMakeFiles" EXCLUDE
|
|
||||||
PATTERN ".svn" EXCLUDE
|
|
||||||
)
|
|
||||||
|
|
||||||
# TODO: make and install documentation.
|
# TODO: make and install documentation.
|
||||||
|
|
||||||
|
@ -26,9 +26,11 @@ macro(add_llvm_library name)
|
|||||||
if( EXCLUDE_FROM_ALL )
|
if( EXCLUDE_FROM_ALL )
|
||||||
set_target_properties( ${name} PROPERTIES EXCLUDE_FROM_ALL ON)
|
set_target_properties( ${name} PROPERTIES EXCLUDE_FROM_ALL ON)
|
||||||
else()
|
else()
|
||||||
install(TARGETS ${name}
|
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "LTO")
|
||||||
LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
|
install(TARGETS ${name}
|
||||||
ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
|
LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
|
||||||
|
ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
set_target_properties(${name} PROPERTIES FOLDER "Libraries")
|
set_target_properties(${name} PROPERTIES FOLDER "Libraries")
|
||||||
|
|
||||||
@ -70,9 +72,11 @@ ${name} ignored.")
|
|||||||
if( EXCLUDE_FROM_ALL )
|
if( EXCLUDE_FROM_ALL )
|
||||||
set_target_properties( ${name} PROPERTIES EXCLUDE_FROM_ALL ON)
|
set_target_properties( ${name} PROPERTIES EXCLUDE_FROM_ALL ON)
|
||||||
else()
|
else()
|
||||||
install(TARGETS ${name}
|
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
|
||||||
LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
|
install(TARGETS ${name}
|
||||||
ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
|
LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
|
||||||
|
ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -96,14 +100,23 @@ macro(add_llvm_executable name)
|
|||||||
endmacro(add_llvm_executable name)
|
endmacro(add_llvm_executable name)
|
||||||
|
|
||||||
|
|
||||||
|
set (LLVM_TOOLCHAIN_TOOLS
|
||||||
|
llvm-ar
|
||||||
|
llvm-objdump
|
||||||
|
)
|
||||||
|
|
||||||
macro(add_llvm_tool name)
|
macro(add_llvm_tool name)
|
||||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_TOOLS_BINARY_DIR})
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_TOOLS_BINARY_DIR})
|
||||||
if( NOT LLVM_BUILD_TOOLS )
|
if( NOT LLVM_BUILD_TOOLS )
|
||||||
set(EXCLUDE_FROM_ALL ON)
|
set(EXCLUDE_FROM_ALL ON)
|
||||||
endif()
|
endif()
|
||||||
add_llvm_executable(${name} ${ARGN})
|
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()
|
endif()
|
||||||
set_target_properties(${name} PROPERTIES FOLDER "Tools")
|
set_target_properties(${name} PROPERTIES FOLDER "Tools")
|
||||||
endmacro(add_llvm_tool name)
|
endmacro(add_llvm_tool name)
|
||||||
|
@ -19,19 +19,21 @@ configure_file(
|
|||||||
${llvm_cmake_builddir}/LLVMConfigVersion.cmake
|
${llvm_cmake_builddir}/LLVMConfigVersion.cmake
|
||||||
@ONLY)
|
@ONLY)
|
||||||
|
|
||||||
install(FILES
|
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
|
||||||
${llvm_cmake_builddir}/LLVMConfig.cmake
|
install(FILES
|
||||||
${llvm_cmake_builddir}/LLVMConfigVersion.cmake
|
${llvm_cmake_builddir}/LLVMConfig.cmake
|
||||||
LLVM-Config.cmake
|
${llvm_cmake_builddir}/LLVMConfigVersion.cmake
|
||||||
DESTINATION share/llvm/cmake)
|
LLVM-Config.cmake
|
||||||
|
DESTINATION share/llvm/cmake)
|
||||||
|
|
||||||
install(DIRECTORY .
|
install(DIRECTORY .
|
||||||
DESTINATION share/llvm/cmake
|
DESTINATION share/llvm/cmake
|
||||||
FILES_MATCHING PATTERN *.cmake
|
FILES_MATCHING PATTERN *.cmake
|
||||||
PATTERN .svn EXCLUDE
|
PATTERN .svn EXCLUDE
|
||||||
PATTERN LLVMConfig.cmake EXCLUDE
|
PATTERN LLVMConfig.cmake EXCLUDE
|
||||||
PATTERN LLVMConfigVersion.cmake EXCLUDE
|
PATTERN LLVMConfigVersion.cmake EXCLUDE
|
||||||
PATTERN LLVM-Config.cmake EXCLUDE
|
PATTERN LLVM-Config.cmake EXCLUDE
|
||||||
PATTERN GetHostTriple.cmake EXCLUDE
|
PATTERN GetHostTriple.cmake EXCLUDE
|
||||||
PATTERN VersionFromVCS.cmake EXCLUDE
|
PATTERN VersionFromVCS.cmake EXCLUDE
|
||||||
PATTERN CheckAtomic.cmake EXCLUDE)
|
PATTERN CheckAtomic.cmake EXCLUDE)
|
||||||
|
endif()
|
||||||
|
Loading…
Reference in New Issue
Block a user