Skip to content

Commit

Permalink
[CMake] Install import libraries
Browse files Browse the repository at this point in the history
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

llvm-svn: 360230
  • Loading branch information
mstorsjo committed May 8, 2019
1 parent 5f7c861 commit e96c98f
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions llvm/cmake/modules/AddLLVM.cmake
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit e96c98f

Please sign in to comment.