diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2021-11-18 22:33:18 +0000 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2021-11-20 08:29:50 -0800 |
commit | 61ca56422b38cb3807ad488e81532b601c89f2d4 (patch) | |
tree | 228058c32839c4459e6952aeb18e6bb1c36b8ea3 /mesonbuild/dependencies | |
parent | 987a26e9e11b841edc37fbe88bae5eadfffa01b9 (diff) | |
download | meson-61ca56422b38cb3807ad488e81532b601c89f2d4.zip meson-61ca56422b38cb3807ad488e81532b601c89f2d4.tar.gz meson-61ca56422b38cb3807ad488e81532b601c89f2d4.tar.bz2 |
cmake: Use find_library() on bare library names in cmake dependencies
Convert bare library names to a dependency linker argument using
find_library(), rather than hardcoding the MSVC transformation.
Diffstat (limited to 'mesonbuild/dependencies')
-rw-r--r-- | mesonbuild/dependencies/cmake.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/mesonbuild/dependencies/cmake.py b/mesonbuild/dependencies/cmake.py index 5386ef9..1b5e2f0 100644 --- a/mesonbuild/dependencies/cmake.py +++ b/mesonbuild/dependencies/cmake.py @@ -617,12 +617,10 @@ class CMakeDependency(ExternalDependency): libraries += [j] elif self.env.machines.build.is_windows() and reg_is_maybe_bare_lib.match(j): # On Windows, CMake library dependencies can be passed as bare library names, - # e.g. 'version' should translate into 'version.lib'. CMake brute-forces a - # combination of prefix/suffix combinations to find the right library, however - # as we do not have a compiler environment available to us, we cannot do the - # same, but must assume any bare argument passed which is not also a CMake - # target must be a system library we should try to link against - libraries += [f"{j}.lib"] + # CMake brute-forces a combination of prefix/suffix combinations to find the + # right library. Assume any bare argument passed which is not also a CMake + # target must be a system library we should try to link against. + libraries += self.clib_compiler.find_library(j, self.env, []) else: mlog.warning('CMake: Dependency', mlog.bold(j), 'for', mlog.bold(name), 'target', mlog.bold(self._original_module_name(curr)), 'was not found') |