[llvm-bugs] [Bug 50965] New: LLVM CMake do not work with vcpkg LibXml2 port

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jul 2 02:25:58 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=50965

            Bug ID: 50965
           Summary: LLVM CMake do not work with vcpkg LibXml2 port
           Product: Build scripts
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: cmake
          Assignee: unassignedbugs at nondot.org
          Reporter: clemens.wasser at gmail.com
                CC: llvm-bugs at lists.llvm.org

I am currently trying to build LLVM with multiple Projects enabled and with
LibXml2 on Windows.
For that I am using vcpkg and it's LibXml2 port from this pull request:
https://github.com/microsoft/vcpkg/pull/17945 (since the current port on master
is broken)
However I am facing the following error:

---

CMake Error at
E:/git/vcpkg/installed/x64-windows-static/share/libxml2/vcpkg-cmake-wrapper.cmake:43
(target_link_libraries):
  Cannot specify link libraries for target "LibXml2::LibXml2" which is not
  built by this project.
Call Stack (most recent call first):
  E:/git/vcpkg/scripts/buildsystems/vcpkg.cmake:725 (include)
  E:/git/llvm-project/clang/CMakeLists.txt:207 (find_package)

---

The problem is that find_package for LibXml2 gets called multiple times and
that the LibXml2::LibXml2 target is immutable after the first call, which is
bad, because vcpkg-cmake-wrapper.cmake tries to modify the target nevertheless
(which causes the issue shown above):
https://github.com/Neumann-A/vcpkg/blob/10faaac739b2c2454f85414f532c58d67dc90e49/ports/libxml2/vcpkg-cmake-wrapper.cmake#L43)
Is the LibXml2::LibXml2 target maybe mistakenly exported globally?
Or couldn't you just call find_package once for LibXml2 and use that target
everywhere?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210702/d945fb63/attachment.html>


More information about the llvm-bugs mailing list