aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-12-26 13:22:03 +0200
committerGitHub <noreply@github.com>2017-12-26 13:22:03 +0200
commit1806aac37669fe5b4a50175b7b8298f119248be3 (patch)
treef90f7e219fd6cc17f6db45093ae8b0f58f851bec /mesonbuild
parentd55e98ef50782ff011f2e44d7c13886a3f6b6d05 (diff)
parent861cbc2e730805ebdea17647f78503a74bd55a34 (diff)
downloadmeson-1806aac37669fe5b4a50175b7b8298f119248be3.zip
meson-1806aac37669fe5b4a50175b7b8298f119248be3.tar.gz
meson-1806aac37669fe5b4a50175b7b8298f119248be3.tar.bz2
Merge pull request #2817 from jon-turney/master
Update prefix-dependent defaults when project(default_options:) changes prefix
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/interpreter.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index f079079..7e29b7c 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.