aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mconf.py
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2021-10-04 11:11:17 -0400
committerEli Schwartz <eschwartz93@gmail.com>2021-10-08 17:47:35 -0400
commit2628ce576ce8269aa2e4988d7b0f5fdd81099f72 (patch)
treedd4d51b6b8b6909f26ac188871648359aaca77f6 /mesonbuild/mconf.py
parent9b2bc0be6dfa3aa2f9bc81a54bdabf93923ec7ea (diff)
downloadmeson-2628ce576ce8269aa2e4988d7b0f5fdd81099f72.zip
meson-2628ce576ce8269aa2e4988d7b0f5fdd81099f72.tar.gz
meson-2628ce576ce8269aa2e4988d7b0f5fdd81099f72.tar.bz2
Add support for module options
Diffstat (limited to 'mesonbuild/mconf.py')
-rw-r--r--mesonbuild/mconf.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/mesonbuild/mconf.py b/mesonbuild/mconf.py
index b58eaa7..cf7040f 100644
--- a/mesonbuild/mconf.py
+++ b/mesonbuild/mconf.py
@@ -17,6 +17,7 @@ import shutil
import os
import textwrap
import typing as T
+import collections
from . import build
from . import coredata
@@ -243,11 +244,18 @@ class Conf:
dir_options: 'coredata.KeyedOptionDictType' = {}
test_options: 'coredata.KeyedOptionDictType' = {}
core_options: 'coredata.KeyedOptionDictType' = {}
+ module_options: T.Dict[str, 'coredata.KeyedOptionDictType'] = collections.defaultdict(dict)
for k, v in self.coredata.options.items():
if k in dir_option_names:
dir_options[k] = v
elif k in test_option_names:
test_options[k] = v
+ elif k.module:
+ # Ignore module options if we did not use that module during
+ # configuration.
+ if self.build and k.module not in self.build.modules:
+ continue
+ module_options[k.module][k] = v
elif k.is_builtin():
core_options[k] = v
@@ -267,6 +275,8 @@ class Conf:
self.print_options('Compiler options', host_compiler_options.get('', {}))
if show_build_options:
self.print_options('', build_compiler_options.get('', {}))
+ for mod, mod_options in module_options.items():
+ self.print_options(f'{mod} module options', mod_options)
self.print_options('Directories', dir_options)
self.print_options('Testing options', test_options)
self.print_options('Project options', project_options.get('', {}))