Skip to content

Commit

Permalink
build: allow specifying the component to llvm_install_symlink
Browse files Browse the repository at this point in the history
Add an optional parameter to `llvm_install_symlink` which allows the symlink
installation to be placed into a specific component rather than the default
value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288600 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
compnerd committed Dec 3, 2016
1 parent d0aaae3 commit 0b69b1f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions cmake/modules/AddLLVM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1254,18 +1254,22 @@ function(llvm_install_library_symlink name dest type)
endfunction()

function(llvm_install_symlink name dest)
cmake_parse_arguments(ARG "ALWAYS_GENERATE" "" "" ${ARGN})
cmake_parse_arguments(ARG "ALWAYS_GENERATE" "COMPONENT" "" ${ARGN})
foreach(path ${CMAKE_MODULE_PATH})
if(EXISTS ${path}/LLVMInstallSymlink.cmake)
set(INSTALL_SYMLINK ${path}/LLVMInstallSymlink.cmake)
break()
endif()
endforeach()

if(ARG_ALWAYS_GENERATE)
set(component ${dest})
if(ARG_COMPONENT)
set(component ${ARG_COMPONENT})
else()
set(component ${name})
if(ARG_ALWAYS_GENERATE)
set(component ${dest})
else()
set(component ${name})
endif()
endif()

set(full_name ${name}${CMAKE_EXECUTABLE_SUFFIX})
Expand Down

0 comments on commit 0b69b1f

Please sign in to comment.