[PATCH] D36540: [CMake] Add install target for LLVMFuzzer
Petr Hosek via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 9 12:24:48 PDT 2017
phosek created this revision.
Herald added a subscriber: mgorny.
This allows including LLVMFuzzer as distribution component.
Repository:
rL LLVM
https://reviews.llvm.org/D36540
Files:
lib/Fuzzer/CMakeLists.txt
Index: lib/Fuzzer/CMakeLists.txt
===================================================================
--- lib/Fuzzer/CMakeLists.txt
+++ lib/Fuzzer/CMakeLists.txt
@@ -57,6 +57,27 @@
$<TARGET_OBJECTS:LLVMFuzzerNoMainObjects>
)
target_link_libraries(LLVMFuzzer ${LLVM_PTHREAD_LIB})
+
+ if(LLVMFuzzer 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 LLVMFuzzer
+ ${export_to_llvmexports}
+ ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
+ COMPONENT LLVMFuzzer)
+
+ if (NOT CMAKE_CONFIGURATION_TYPES)
+ add_custom_target(install-LLVMFuzzer
+ DEPENDS LLVMFuzzer
+ COMMAND "${CMAKE_COMMAND}"
+ -DCMAKE_INSTALL_COMPONENT=LLVMFuzzer
+ -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
+ endif()
+
+ set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS LLVMFuzzer)
endif()
if (MSVC)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36540.110451.patch
Type: text/x-patch
Size: 1089 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170809/ba56a629/attachment.bin>
More information about the llvm-commits
mailing list