[llvm] r310897 - [CMake] Add install target for LLVMFuzzer
Petr Hosek via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 14 16:37:31 PDT 2017
Author: phosek
Date: Mon Aug 14 16:37:31 2017
New Revision: 310897
URL: http://llvm.org/viewvc/llvm-project?rev=310897&view=rev
Log:
[CMake] Add install target for LLVMFuzzer
This allows including LLVMFuzzer as distribution component.
Differential Revision: https://reviews.llvm.org/D36540
Modified:
llvm/trunk/lib/Fuzzer/CMakeLists.txt
Modified: llvm/trunk/lib/Fuzzer/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/CMakeLists.txt?rev=310897&r1=310896&r2=310897&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/CMakeLists.txt (original)
+++ llvm/trunk/lib/Fuzzer/CMakeLists.txt Mon Aug 14 16:37:31 2017
@@ -63,6 +63,27 @@ if (LIBFUZZER_ENABLE)
$<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)
More information about the llvm-commits
mailing list