[llvm] c3595d1 - build: process the libxml2 library path for embedding

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 28 17:25:30 PST 2020


This broke MSVC:
http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/14538
I pushed a speculative fix, but who knows if it'll do the trick.

On Thu, Feb 27, 2020 at 10:01 PM Saleem Abdulrasool via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

>
> Author: Saleem Abdulrasool
> Date: 2020-02-27T22:00:30-08:00
> New Revision: c3595d1069277b4ab0df49d7139b6f1bbc94f21c
>
> URL:
> https://github.com/llvm/llvm-project/commit/c3595d1069277b4ab0df49d7139b6f1bbc94f21c
> DIFF:
> https://github.com/llvm/llvm-project/commit/c3595d1069277b4ab0df49d7139b6f1bbc94f21c.diff
>
> LOG: build: process the libxml2 library path for embedding
>
> Process the path for libxml2 before embedding that into the command line
> that is generated in `llvm-config`.  Each element in the path is being
> given a `-l` unconditionally which should not be the case for absolute
> paths.  Since the library path may be absolute or not, just apply some
> CMake pre-processing when generating the path.
>
> Before:
> ```
> /usr/lib/x86_64-linux-gnu/libz.so -lrt -ldl -ltinfo -lpthread -lm
> /usr/lib/x86_64-linux-gnu/libxml2.so
> ```
>
> After:
> ```
> /usr/lib/x86_64-linux-gnu/libz.so -lrt -ldl -ltinfo -lpthread -lm -lxml2
> ```
>
> Resolves PR44179!
>
> Added:
>
>
> Modified:
>     llvm/lib/WindowsManifest/CMakeLists.txt
>
> Removed:
>
>
>
>
> ################################################################################
> diff  --git a/llvm/lib/WindowsManifest/CMakeLists.txt
> b/llvm/lib/WindowsManifest/CMakeLists.txt
> index fe6ddcd414d5..8cfea1282ad6 100644
> --- a/llvm/lib/WindowsManifest/CMakeLists.txt
> +++ b/llvm/lib/WindowsManifest/CMakeLists.txt
> @@ -7,6 +7,15 @@ add_llvm_component_library(LLVMWindowsManifest
>
>  if(LIBXML2_LIBRARIES)
>    target_link_libraries(LLVMWindowsManifest PUBLIC ${LIBXML2_LIBRARIES})
> +
> +  get_filename_component(xml2_library ${LIBXML2_LIBRARIES} NAME)
> +  if(xml2_library MATCHES
> "^${CMAKE_STATIC_LIBRARY_PREFIX}.*${CMAKE_STATIC_LIBRARY_SUFFIX}$")
> +    string(REGEX REPLACE "^${CMAKE_STATIC_LIBRARY_PREFIX}" ""
> xml2_library ${xml2_library})
> +    string(REGEX REPLACE "${CMAKE_STATIC_LIBRARY_SUFFIX}$" ""
> xml2_library ${xml2_library})
> +  elseif(xml2_library MATCHES
> "^${CMAKE_SHARED_LIBRARY_PREFIX}.*${CMAKE_SHARED_LIBRARY_SUFFIX}$")
> +    string(REGEX REPLACE "^${CMAKE_SHARED_LIBRARY_PREFIX}" ""
> xml2_library ${xml2_library})
> +    string(REGEX REPLACE "${CMAKE_SHARED_LIBRARY_SUFFIX}$" ""
> xml2_library ${xml2_library})
> +  endif()
>    set_property(TARGET LLVMWindowsManifest PROPERTY
> -    LLVM_SYSTEM_LIBS ${LIBXML2_LIBRARIES})
> +    LLVM_SYSTEM_LIBS ${xml2_library})
>  endif()
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200228/1d22eab3/attachment.html>


More information about the llvm-commits mailing list