mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-26 10:29:36 +00:00
CMake: system for providing llvm-config-like features to the user.
The user can use a cmake function for obtaining the LLVM libraries corresponding to a list of LLVM components. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110560 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fd2f3e66fe
commit
6252e98709
@ -361,6 +361,8 @@ add_subdirectory(tools)
|
|||||||
option(LLVM_BUILD_EXAMPLES "Build LLVM example programs." OFF)
|
option(LLVM_BUILD_EXAMPLES "Build LLVM example programs." OFF)
|
||||||
add_subdirectory(examples)
|
add_subdirectory(examples)
|
||||||
|
|
||||||
|
add_subdirectory(cmake/modules)
|
||||||
|
|
||||||
install(DIRECTORY include/
|
install(DIRECTORY include/
|
||||||
DESTINATION include
|
DESTINATION include
|
||||||
FILES_MATCHING
|
FILES_MATCHING
|
||||||
|
11
cmake/modules/CMakeLists.txt
Normal file
11
cmake/modules/CMakeLists.txt
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/share/llvm/cmake")
|
||||||
|
|
||||||
|
configure_file(
|
||||||
|
LLVM.cmake
|
||||||
|
${llvm_cmake_builddir}/LLVM.cmake)
|
||||||
|
|
||||||
|
install(FILES
|
||||||
|
${llvm_cmake_builddir}/LLVM.cmake
|
||||||
|
LLVMConfig.cmake
|
||||||
|
LLVMLibDeps.cmake
|
||||||
|
DESTINATION share/llvm/cmake)
|
19
cmake/modules/LLVM.cmake
Normal file
19
cmake/modules/LLVM.cmake
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
set(LLVM_COMMON_DEPENDS @LLVM_COMMON_DEPENDS@)
|
||||||
|
|
||||||
|
set(llvm_libs @llvm_libs@)
|
||||||
|
|
||||||
|
set(llvm_lib_targets @llvm_lib_targets@)
|
||||||
|
|
||||||
|
set(LLVM_TARGETS_TO_BUILD @LLVM_TARGETS_TO_BUILD@)
|
||||||
|
|
||||||
|
set(LLVM_TOOLS_BINARY_DIR @LLVM_TOOLS_BINARY_DIR@)
|
||||||
|
|
||||||
|
set(HAVE_LLVM_CONFIG @HAVE_LLVM_CONFIG@)
|
||||||
|
|
||||||
|
if( NOT EXISTS LLVMConfig.cmake )
|
||||||
|
set(CMAKE_MODULE_PATH
|
||||||
|
${CMAKE_MODULE_PATH}
|
||||||
|
"@LLVM_SOURCE_DIR@/cmake/modules")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include( LLVMConfig )
|
@ -49,6 +49,13 @@ function(explicit_llvm_config executable)
|
|||||||
endfunction(explicit_llvm_config)
|
endfunction(explicit_llvm_config)
|
||||||
|
|
||||||
|
|
||||||
|
# This is a variant intended for the final user:
|
||||||
|
function(llvm_map_components_to_libraries OUT_VAR)
|
||||||
|
explicit_map_components_to_libraries(result ${ARGN})
|
||||||
|
set( ${OUT_VAR} ${result} )
|
||||||
|
endfunction(llvm_map_components_to_libraries)
|
||||||
|
|
||||||
|
|
||||||
function(explicit_map_components_to_libraries out_libs)
|
function(explicit_map_components_to_libraries out_libs)
|
||||||
set( link_components ${ARGN} )
|
set( link_components ${ARGN} )
|
||||||
foreach(c ${link_components})
|
foreach(c ${link_components})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user