aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2017-12-21 13:20:26 +0000
committerJon Turney <jon.turney@dronecode.org.uk>2017-12-21 19:21:49 +0000
commit861cbc2e730805ebdea17647f78503a74bd55a34 (patch)
tree7fe9b656d2b50556766d5f3918e2a3d44df43c28
parent198251395a36b9b2e9e9b903b6de92786fd86d6e (diff)
downloadmeson-861cbc2e730805ebdea17647f78503a74bd55a34.zip
meson-861cbc2e730805ebdea17647f78503a74bd55a34.tar.gz
meson-861cbc2e730805ebdea17647f78503a74bd55a34.tar.bz2
Update prefix-dependent defaults when project(default_options:) changes prefix
Fixes #2811
-rw-r--r--mesonbuild/interpreter.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index 93f4b1a..b45e4c6 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -1813,9 +1813,18 @@ to directly access options of other subprojects.''')
if coredata.is_builtin_option(key):
if self.subproject != '':
continue # Only the master project is allowed to set global options.
+ # If this was set on the command line, do not override.
if not self.environment.had_argument_for(key):
self.coredata.set_builtin_option(key, value)
- # If this was set on the command line, do not override.
+ # If we are setting the prefix, then other options which
+ # have prefix-dependent defaults need their value updating,
+ # if they haven't been explicitly set (i.e. have their
+ # default value)
+ if key == 'prefix':
+ for option in coredata.builtin_dir_noprefix_options:
+ if not (self.environment.had_argument_for(option) or
+ any([k.startswith(option + '=') for k in default_options])):
+ self.coredata.set_builtin_option(option, coredata.get_builtin_option_default(option, value))
else:
# Option values set with subproject() default_options override those
# set in project() default_options.