From dfc07fc03637cb404d9ee164d20da5b143855733 Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Fri, 26 Feb 2021 05:30:50 -0500 Subject: build: Allow recipes to enable cmake support for meson This was disabled as an optimisation on Windows but might be needed by some recipes, so let's allow them to opt-in. Part-of: --- cerbero/build/build.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cerbero/build/build.py b/cerbero/build/build.py index ec9ed017..9434026b 100644 --- a/cerbero/build/build.py +++ b/cerbero/build/build.py @@ -732,6 +732,8 @@ class Meson (Build, ModifyEnvBase) : # Build files require a build machine compiler when cross-compiling meson_needs_build_machine_compiler = False meson_builddir = "_builddir" + # We do not use cmake dependency files by default, speed up the build by disabling it + need_cmake = False def __init__(self): self.meson_options = self.meson_options or {} @@ -757,6 +759,10 @@ class Meson (Build, ModifyEnvBase) : if not self.make_clean: self.make_clean = self.make + ['clean'] + # Allow CMake dependencies to be found if requested + if self.need_cmake: + self.append_env('CMAKE_PREFIX_PATH', self.config.prefix, sep=os.pathsep) + @staticmethod def _get_option_value(opt_type, value): if opt_type == 'feature': @@ -894,8 +900,10 @@ class Meson (Build, ModifyEnvBase) : else: props[key] += value - # We do not use cmake dependency files, speed up the build by disabling it - binaries = {'cmake': ['false']} + if self.need_cmake: + binaries = {} + else: + binaries = {'cmake': ['false']} # Get qmake and moc paths if self.config.qt5_qmake_path: binaries['qmake'] = [self.config.qt5_qmake_path] -- cgit v1.2.3