summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniele Nicolodi <daniele@grinta.net>2025-10-19 15:45:45 +0200
committerDylan Baker <dylan@pnwbakers.com>2025-10-24 08:13:21 -0700
commitdc64570008e7b1dbbcda88d6e000808cfb52dcaa (patch)
tree0c522cf7207ae699d7044d120c24cd49d812b22b
parenta907c66cf93b1ded17aebd1ac35a1096d2866cf8 (diff)
downloadmeson-dc64570008e7b1dbbcda88d6e000808cfb52dcaa.tar.gz
cmake: Set CMAKE_INSTALL_LIBDIR explicitly
CMake and Meson may disagree on the default value of the libdir installation path. This results in shared libraries installed in the default location not assigned to the {libdir_shared} install location by the Meson CMake interpreter. This results in wrong install plan metadata and in those libraries being installed in the wrong location. Fixes #12960.
-rw-r--r--mesonbuild/cmake/interpreter.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/mesonbuild/cmake/interpreter.py b/mesonbuild/cmake/interpreter.py
index 17c076e69..bdaa6d54c 100644
--- a/mesonbuild/cmake/interpreter.py
+++ b/mesonbuild/cmake/interpreter.py
@@ -842,6 +842,8 @@ class CMakeInterpreter:
cmake_args = []
cmake_args += cmake_get_generator_args(self.env)
cmake_args += [f'-DCMAKE_INSTALL_PREFIX={self.install_prefix}']
+ libdir = self.env.coredata.optstore.get_value_for(OptionKey('libdir'))
+ cmake_args += [f'-DCMAKE_INSTALL_LIBDIR={libdir}']
cmake_args += extra_cmake_options
if not any(arg.startswith('-DCMAKE_BUILD_TYPE=') for arg in cmake_args):
# Our build type is favored over any CMAKE_BUILD_TYPE environment variable