From: Martin Storsjo Date: Wed, 8 May 2019 08:37:34 +0000 (+0000) Subject: [CMake] Install import libraries X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6c7c3ccf18d72c3a7cb8f9a3222d9d18ad4facda;p=llvm [CMake] Install import libraries Simplify the cmake logic to install both runtime and import libraries (treated as ARCHIVE), as the later are needed to link against llvm. Patch by Julien Schueller! Differential Revision: https://reviews.llvm.org/D61425 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360230 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake index d10831ff028..c9b4f2aa48f 100644 --- a/cmake/modules/AddLLVM.cmake +++ b/cmake/modules/AddLLVM.cmake @@ -671,21 +671,6 @@ macro(add_llvm_library name) if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "LTO" OR ${name} STREQUAL "Remarks" OR (LLVM_LINK_LLVM_DYLIB AND ${name} STREQUAL "LLVM")) - set(install_dir lib${LLVM_LIBDIR_SUFFIX}) - if(ARG_MODULE OR ARG_SHARED OR BUILD_SHARED_LIBS) - if(WIN32 OR CYGWIN OR MINGW) - set(install_type RUNTIME) - set(install_dir bin) - else() - set(install_type LIBRARY) - endif() - else() - set(install_type ARCHIVE) - endif() - - if (ARG_MODULE) - set(install_type LIBRARY) - endif() set(export_to_llvmexports) if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR @@ -697,7 +682,9 @@ macro(add_llvm_library name) install(TARGETS ${name} ${export_to_llvmexports} - ${install_type} DESTINATION ${install_dir} + LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} + ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} + RUNTIME DESTINATION bin COMPONENT ${name}) if (NOT LLVM_ENABLE_IDE)