Skip to content

Commit b386447

Browse files
committed
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.
1 parent 6bf55bf commit b386447

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

mesonbuild/cmake/interpreter.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -842,6 +842,8 @@ def configure(self, extra_cmake_options: T.List[str]) -> CMakeExecutor:
842842
cmake_args = []
843843
cmake_args += cmake_get_generator_args(self.env)
844844
cmake_args += [f'-DCMAKE_INSTALL_PREFIX={self.install_prefix}']
845+
libdir = self.env.coredata.optstore.get_value_for(OptionKey('libdir'))
846+
cmake_args += [f'-DCMAKE_INSTALL_LIBDIR={libdir}']
845847
cmake_args += extra_cmake_options
846848
if not any(arg.startswith('-DCMAKE_BUILD_TYPE=') for arg in cmake_args):
847849
# Our build type is favored over any CMAKE_BUILD_TYPE environment variable

0 commit comments

Comments
 (0)