summaryrefslogtreecommitdiff
path: root/methods.py
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-06-03 14:38:30 +0200
committerGitHub <noreply@github.com>2020-06-03 14:38:30 +0200
commit65a787111da0bc206946d5a8f56ca6942331fe32 (patch)
tree54561ee27ee79cf97ce52f7399863917a7266175 /methods.py
parent901832e21c74d20689cd59a3464581467997e57c (diff)
parent7c743122172e7f32f184081f743346ad6ac5b332 (diff)
Merge pull request #39240 from akien-mga/scons-fix-multimedia-lib-deps
SCons: Validate dependencies for linked multimedia modules
Diffstat (limited to 'methods.py')
-rw-r--r--methods.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/methods.py b/methods.py
index c1245cd95a..756db19e9a 100644
--- a/methods.py
+++ b/methods.py
@@ -231,6 +231,30 @@ def disable_module(self):
self.disabled_modules.append(self.current_module)
+def module_check_dependencies(self, module, dependencies):
+ """
+ Checks if module dependencies are enabled for a given module,
+ and prints a warning if they aren't.
+ Meant to be used in module `can_build` methods.
+ Returns a boolean (True if dependencies are satisfied).
+ """
+ missing_deps = []
+ for dep in dependencies:
+ opt = "module_{}_enabled".format(dep)
+ if not opt in self or not self[opt]:
+ missing_deps.append(dep)
+
+ if missing_deps != []:
+ print(
+ "Disabling '{}' module as the following dependencies are not satisfied: {}".format(
+ module, ", ".join(missing_deps)
+ )
+ )
+ return False
+ else:
+ return True
+
+
def use_windows_spawn_fix(self, platform=None):
if os.name != "nt":