diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake @@ -639,7 +639,7 @@ endfunction() function(add_llvm_install_targets target) - cmake_parse_arguments(ARG "" "COMPONENT;PREFIX" "DEPENDS" ${ARGN}) + cmake_parse_arguments(ARG "" "COMPONENT;PREFIX;SYMLINK" "DEPENDS" ${ARGN}) if(ARG_COMPONENT) set(component_option -DCMAKE_INSTALL_COMPONENT="${ARG_COMPONENT}") endif() @@ -676,6 +676,11 @@ add_dependencies(${target} ${target_dependencies}) add_dependencies(${target}-stripped ${target_dependencies}) endif() + + if(ARG_SYMLINK) + add_dependencies(${target} install-${ARG_SYMLINK}) + add_dependencies(${target}-stripped install-${ARG_SYMLINK}-stripped) + endif() endfunction() function(add_llvm_component_library name) @@ -1545,8 +1550,9 @@ if (NOT LLVM_ENABLE_IDE AND NOT ARG_ALWAYS_GENERATE) add_llvm_install_targets(install-${name} - DEPENDS ${name} ${dest} install-${dest} - COMPONENT ${name}) + DEPENDS ${name} ${dest} + COMPONENT ${name} + SYMLINK ${dest}) endif() endfunction() @@ -1578,8 +1584,9 @@ if (NOT LLVM_ENABLE_IDE AND NOT ARG_ALWAYS_GENERATE) add_llvm_install_targets(install-${name} - DEPENDS ${name} ${dest} install-${dest} - COMPONENT ${name}) + DEPENDS ${name} ${dest} + COMPONENT ${name} + SYMLINK ${dest}) endif() endfunction()