Ticket #50509: fix-PR26393.patch

File fix-PR26393.patch, 1.5 KB (added by howarth.at.macports@…, 9 years ago)

patch to prune static LLVM component lib linkages when LLVM_LINK_LLVM_DYLIB is enabled

  • llvm/cmake/modules/AddLLVM.cmake

    old new  
    477477
    478478  if (LLVM_LINK_LLVM_DYLIB AND NOT ARG_STATIC AND NOT ARG_DISABLE_LLVM_LINK_LLVM_DYLIB)
    479479    set(llvm_libs LLVM)
    480   else()
     480  elseif(NOT LLVM_LINK_LLVM_DYLIB OR ARG_DISABLE_LLVM_LINK_LLVM_DYLIB)
    481481    llvm_map_components_to_libnames(llvm_libs
    482482      ${ARG_LINK_COMPONENTS}
    483483      ${LLVM_LINK_COMPONENTS}
  • llvm/cmake/modules/LLVM-Config.cmake

    old new  
    4040    # done in case libLLVM does not contain all of the components
    4141    # the target requires.
    4242    #
    43     # TODO strip LLVM_DYLIB_COMPONENTS out of link_components.
     43    # Strip LLVM_DYLIB_COMPONENTS out of link_components.
    4444    # To do this, we need special handling for "all", since that
    4545    # may imply linking to libraries that are not included in
    4646    # libLLVM.
     47    if (DEFINED link_components AND DEFINED LLVM_DYLIB_COMPONENTS)
     48      if("${LLVM_DYLIB_COMPONENTS}" STREQUAL "all")               
     49        set(link_components "")                                   
     50      else()                                                     
     51        list(REMOVE_ITEM link_components ${LLVM_DYLIB_COMPONENTS})
     52      endif()                                                     
     53    endif()                                                       
    4754    target_link_libraries(${executable} LLVM)
    4855  endif()
    4956