Skip to content

Commit

Permalink
[llvm] [cmake] Add install targets for missing distribution components
Browse files Browse the repository at this point in the history
Add install targets as necessary to include all files normally installed
in LLVM_DISTRIBUTION_COMPONENTS.  This includes targets for Sphinx docs,
opt-viewer Python modules and TableGens.

Differential Revision: https://reviews.llvm.org/D68339

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373482 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
mgorny committed Oct 2, 2019
1 parent f8023e3 commit d40d55b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cmake/modules/AddSphinxTarget.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ function (add_sphinx_target builder project)
COMPONENT "${project}-sphinx-man"
DESTINATION ${INSTALL_MANDIR}man1)

if(NOT LLVM_ENABLE_IDE)
add_llvm_install_targets("install-${SPHINX_TARGET_NAME}"
DEPENDS ${SPHINX_TARGET_NAME}
COMPONENT "${project}-sphinx-man")
endif()
elseif (builder STREQUAL html)
string(TOUPPER "${project}" project_upper)
set(${project_upper}_INSTALL_SPHINX_HTML_DIR "share/doc/${project}/html"
Expand All @@ -82,6 +87,12 @@ function (add_sphinx_target builder project)
install(DIRECTORY "${SPHINX_BUILD_DIR}/."
COMPONENT "${project}-sphinx-html"
DESTINATION "${${project_upper}_INSTALL_SPHINX_HTML_DIR}")

if(NOT LLVM_ENABLE_IDE)
add_llvm_install_targets("install-${SPHINX_TARGET_NAME}"
DEPENDS ${SPHINX_TARGET_NAME}
COMPONENT "${project}-sphinx-html")
endif()
else()
message(WARNING Installation of ${builder} not supported)
endif()
Expand Down
6 changes: 6 additions & 0 deletions cmake/modules/TableGen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,13 @@ macro(add_tablegen target project)

install(TARGETS ${target}
${export_to_llvmexports}
COMPONENT ${target}
RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR})
if(NOT LLVM_ENABLE_IDE)
add_llvm_install_targets("install-${target}"
DEPENDS ${target}
COMPONENT ${target})
endif()
endif()
set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${target})
endmacro()
7 changes: 7 additions & 0 deletions tools/opt-viewer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,10 @@ foreach (file ${files})
DESTINATION share/opt-viewer
COMPONENT opt-viewer)
endforeach (file)

add_custom_target(opt-viewer DEPENDS ${files})
if(NOT LLVM_ENABLE_IDE)
add_llvm_install_targets("install-opt-viewer"
DEPENDS opt-viewer
COMPONENT opt-viewer)
endif()

0 comments on commit d40d55b

Please sign in to comment.