llvm.org GIT mirror llvm / 4ce5f86
[CMake] Add install targets for utilities to LLVM exports if LLVM_INSTALL_UTILS=ON Summary: D56606 was only appending target names to the `LLVM_EXPORTS`/`LLVM_EXPORTS_BUILDTREE_ONLY` properties. Targets showed up correctly in the build-tree `LLVMExports.cmake`, but they were missing in the installed one (as we found in https://bugs.llvm.org/show_bug.cgi?id=40443), because install did not register them explicitly. Reviewers: mgorny, smeenai, beanz, gottesmm, dschuff, tstellar, serge-sans-paille Reviewed By: smeenai Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D57383 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352869 91177308-0d34-0410-b5e6-96231b3b80d8 Stefan Granitz 8 months ago
1 changed file(s) with 22 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
910910
911911 add_llvm_executable(${name} DISABLE_LLVM_LINK_LLVM_DYLIB ${ARGN})
912912 set_target_properties(${name} PROPERTIES FOLDER "Utils")
913 if( LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS )
914 install (TARGETS ${name}
915 RUNTIME DESTINATION ${LLVM_UTILS_INSTALL_DIR}
916 COMPONENT ${name})
917 if (NOT LLVM_ENABLE_IDE)
918 add_llvm_install_targets(install-${name}
919 DEPENDS ${name}
920 COMPONENT ${name})
921 endif()
922 set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name})
923 elseif( LLVM_BUILD_UTILS )
924 set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS_BUILDTREE_ONLY ${name})
913 if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
914 if (LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS)
915 if (${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
916 NOT LLVM_DISTRIBUTION_COMPONENTS)
917 set(export_to_llvmexports EXPORT LLVMExports)
918 set_property(GLOBAL PROPERTY LLVM_HAS_EXPORTS True)
919 endif()
920
921 install(TARGETS ${name}
922 ${export_to_llvmexports}
923 RUNTIME DESTINATION ${LLVM_UTILS_INSTALL_DIR}
924 COMPONENT ${name})
925
926 if (NOT LLVM_ENABLE_IDE)
927 add_llvm_install_targets(install-${name}
928 DEPENDS ${name}
929 COMPONENT ${name})
930 endif()
931 set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name})
932 elseif(LLVM_BUILD_UTILS)
933 set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS_BUILDTREE_ONLY ${name})
934 endif()
925935 endif()
926936 endmacro(add_llvm_utility name)
927937