MSVC: Teach find_library to consider Rust's '${name}.dll.lib' convention

This convention is used by Rust toolchains (rustc/cargo/cargo-c) for the
MSVC ABI.

Fixes: #25478
This commit is contained in:
Daniel Ching
2023-12-06 22:47:47 -06:00
parent 7598ea5389
commit f20c5c6f20
7 changed files with 19 additions and 6 deletions

View File

@@ -5,8 +5,8 @@ Suffixes to append when looking for libraries.
This specifies what suffixes to add to library names when the
:command:`find_library` command looks for libraries. On Windows systems this
is typically ``.lib`` and, depending on the compiler, ``.dll.a``, ``.a``
(e.g. GCC and Clang), so when it tries to find the ``foo`` library, it will
look for ``[<prefix>]foo.lib`` and/or ``[<prefix>]foo[.dll].a``, depending on
the compiler used and the ``<prefix>`` specified in the
:variable:`CMAKE_FIND_LIBRARY_PREFIXES`.
is typically ``.lib`` and, depending on the compiler, ``.dll.lib``, ``.dll.a``,
``.a`` (e.g. rustc, GCC, or Clang), so when it tries to find the ``foo``
library, it will look for ``[<prefix>]foo[.dll].lib`` and/or
``[<prefix>]foo[.dll].a``, depending on the compiler used and the ``<prefix>``
specified in the :variable:`CMAKE_FIND_LIBRARY_PREFIXES`.