Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions mesonbuild/cmake/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -786,12 +786,12 @@ def log(self) -> None:
mlog.log(' -- depends: ', mlog.bold(str(self.depends)))

class CMakeInterpreter:
def __init__(self, subdir: Path, install_prefix: Path, env: 'Environment', backend: 'Backend'):
def __init__(self, subdir: Path, env: 'Environment', backend: 'Backend'):
self.subdir = subdir
self.src_dir = Path(env.get_source_dir(), subdir)
self.build_dir_rel = subdir / '__CMake_build'
self.build_dir = Path(env.get_build_dir()) / self.build_dir_rel
self.install_prefix = install_prefix
self.install_prefix = Path(T.cast('str', env.coredata.optstore.get_value_for(OptionKey('prefix'))))
self.env = env
self.for_machine = MachineChoice.HOST # TODO make parameter
self.backend_name = backend.name
Expand Down Expand Up @@ -842,6 +842,8 @@ def configure(self, extra_cmake_options: T.List[str]) -> CMakeExecutor:
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
Expand Down
4 changes: 1 addition & 3 deletions mesonbuild/interpreter/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1049,12 +1049,10 @@ def _do_subproject_cmake(self, subp_name: str, subdir: str,
kwargs: kwtypes.DoSubproject) -> SubprojectHolder:
from ..cmake import CMakeInterpreter
with mlog.nested(subp_name):
prefix = self.coredata.optstore.get_value_for('prefix')

from ..modules.cmake import CMakeSubprojectOptions
kw_opts = kwargs.get('options') or CMakeSubprojectOptions()
cmake_options = kwargs.get('cmake_options', []) + kw_opts.cmake_options
cm_int = CMakeInterpreter(Path(subdir), Path(prefix), self.build.environment, self.backend)
cm_int = CMakeInterpreter(Path(subdir), self.build.environment, self.backend)
cm_int.initialise(cmake_options)
cm_int.analyse()

Expand Down
Loading