[PATCH] D132441: Fix FindZ3.cmake's version detection mechanism

Mikhail Korolev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 24 01:50:38 PDT 2022


stilriv added a comment.

In D132441#3779356 <https://reviews.llvm.org/D132441#3779356>, @Naville wrote:

> Browsed through my catalog and found one.
> Basically, vcpkg put libZ3.dll in its own "exported toolchain folder", and then you use it with ``-DCMAKE_TOOLCHAIN_FILE=vcpkg/...../vcpkg.cmake XXXXX``.
> In this case, libZ3.dll is not copied into the same directory with the built test program, nor is it in system DLL path, hence broke current FindZ3.cmake in another completely different way
>
> EDIT01:
> Plus, I see no reason why we can't always use the regex path as the final fallback plan
>
> EDIT02:
>
>> for a failure to link Z3 with Clang later?
>
> This will not broke in the case mentioned above, because CMake guides the linker to link the  "stub library" instead, and only requires the .dll when actually running

You are describing problem with the toolchain here, not with LLVM's cmakes. And, IMO, this should be fixed on the toolchain side (in your case by adding directory with libZ3.dll to the PATH variable). The advantage of `try_run` path is that it is clearly diagnose problems with [broken] toolchain during configuration phase, so instead of getting broken LLVM libs after compilation you get early configuration error.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132441/new/

https://reviews.llvm.org/D132441



More information about the llvm-commits mailing list