[llvm] r352869 - [CMake] Add install targets for utilities to LLVM exports if LLVM_INSTALL_UTILS=ON
Stefan Granitz via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 1 05:08:09 PST 2019
Author: stefan.graenitz
Date: Fri Feb 1 05:08:09 2019
New Revision: 352869
URL: http://llvm.org/viewvc/llvm-project?rev=352869&view=rev
Log:
[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
Modified:
llvm/trunk/cmake/modules/AddLLVM.cmake
Modified: llvm/trunk/cmake/modules/AddLLVM.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/AddLLVM.cmake?rev=352869&r1=352868&r2=352869&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/AddLLVM.cmake (original)
+++ llvm/trunk/cmake/modules/AddLLVM.cmake Fri Feb 1 05:08:09 2019
@@ -911,18 +911,28 @@ macro(add_llvm_utility name)
add_llvm_executable(${name} DISABLE_LLVM_LINK_LLVM_DYLIB ${ARGN})
set_target_properties(${name} PROPERTIES FOLDER "Utils")
- if( LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS )
- install (TARGETS ${name}
- RUNTIME DESTINATION ${LLVM_UTILS_INSTALL_DIR}
- COMPONENT ${name})
- if (NOT LLVM_ENABLE_IDE)
- add_llvm_install_targets(install-${name}
- DEPENDS ${name}
- COMPONENT ${name})
+ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
+ if (LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS)
+ if (${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
+ NOT LLVM_DISTRIBUTION_COMPONENTS)
+ set(export_to_llvmexports EXPORT LLVMExports)
+ set_property(GLOBAL PROPERTY LLVM_HAS_EXPORTS True)
+ endif()
+
+ install(TARGETS ${name}
+ ${export_to_llvmexports}
+ RUNTIME DESTINATION ${LLVM_UTILS_INSTALL_DIR}
+ COMPONENT ${name})
+
+ if (NOT LLVM_ENABLE_IDE)
+ add_llvm_install_targets(install-${name}
+ DEPENDS ${name}
+ COMPONENT ${name})
+ endif()
+ set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name})
+ elseif(LLVM_BUILD_UTILS)
+ set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS_BUILDTREE_ONLY ${name})
endif()
- set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name})
- elseif( LLVM_BUILD_UTILS )
- set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS_BUILDTREE_ONLY ${name})
endif()
endmacro(add_llvm_utility name)
More information about the llvm-commits
mailing list