diff options
-rw-r--r-- | docs/markdown/Keyval-module.md (renamed from docs/markdown/Kconfig-module.md) | 27 | ||||
-rw-r--r-- | docs/markdown/snippets/keyval_kobject.md | 6 | ||||
-rw-r--r-- | docs/sitemap.txt | 2 | ||||
-rw-r--r-- | docs/theme/extra/templates/navbar_links.html | 2 | ||||
-rw-r--r-- | mesonbuild/modules/unstable_keyval.py (renamed from mesonbuild/modules/unstable_kconfig.py) | 10 | ||||
-rwxr-xr-x | run_project_tests.py | 4 | ||||
-rw-r--r-- | test cases/common/222 source set realistic example/meson.build | 6 | ||||
-rw-r--r-- | test cases/keyval/1 basic/.config (renamed from test cases/kconfig/1 basic/.config) | 0 | ||||
-rw-r--r-- | test cases/keyval/1 basic/meson.build (renamed from test cases/kconfig/1 basic/meson.build) | 4 | ||||
-rw-r--r-- | test cases/keyval/2 subdir/.config (renamed from test cases/kconfig/2 subdir/.config) | 0 | ||||
-rw-r--r-- | test cases/keyval/2 subdir/dir/meson.build (renamed from test cases/kconfig/2 subdir/dir/meson.build) | 2 | ||||
-rw-r--r-- | test cases/keyval/2 subdir/meson.build (renamed from test cases/kconfig/3 load_config files/meson.build) | 2 | ||||
-rw-r--r-- | test cases/keyval/3 load_config files/dir/config (renamed from test cases/kconfig/3 load_config files/dir/config) | 0 | ||||
-rw-r--r-- | test cases/keyval/3 load_config files/dir/meson.build (renamed from test cases/kconfig/3 load_config files/dir/meson.build) | 2 | ||||
-rw-r--r-- | test cases/keyval/3 load_config files/meson.build (renamed from test cases/kconfig/2 subdir/meson.build) | 2 | ||||
-rw-r--r-- | test cases/keyval/4 load_config builddir/config (renamed from test cases/kconfig/4 load_config builddir/config) | 0 | ||||
-rw-r--r-- | test cases/keyval/4 load_config builddir/meson.build (renamed from test cases/kconfig/4 load_config builddir/meson.build) | 4 |
17 files changed, 40 insertions, 33 deletions
diff --git a/docs/markdown/Kconfig-module.md b/docs/markdown/Keyval-module.md index 5807f8d..643265e 100644 --- a/docs/markdown/Kconfig-module.md +++ b/docs/markdown/Keyval-module.md @@ -1,15 +1,15 @@ --- -short-description: Unstable kconfig module +short-description: Unstable keyval module authors: - name: Mark Schulte, Paolo Bonzini years: [2017, 2019] has-copyright: false ... -# Unstable kconfig module +# keyval module -This module parses Kconfig output files to allow use of kconfig -configurations in meson projects. +This module parses files consisting of a series of `key=value` lines. One use +of this module is to load kconfig configurations in meson projects. **Note**:Â this does not provide kconfig frontend tooling to generate a configuration. You still need something such as kconfig frontends (see @@ -23,20 +23,23 @@ chosen the configuration options), output a ".config" file. The module may be imported as follows: ``` meson -kconfig = import('unstable-kconfig') +keyval = import('unstable-keyval') ``` The following functions will then be available as methods on the object -with the name `kconfig`. You can, of course, replace the name -`kconfig` with anything else. +with the name `keyval`. You can, of course, replace the name +`keyval` with anything else. -### kconfig.load() +### keyval.load() -This function loads a kconfig output file and returns a dictionary object. +This function loads a file consisting of a series of `key=value` lines +and returns a dictionary object. -`kconfig.load()` makes no attempt at parsing the values in the -file. Therefore, true boolean values will be represented as the string "y" -and integer values will have to be converted with `.to_int()`. +`keyval.load()` makes no attempt at parsing the values in the file. +In particular boolean and integer values will be represented as strings, +and strings will keep any quoting that is present in the input file. It +can be useful to create a [`configuration_data()`](#configuration_data) +object from the dictionary and use methods such as `get_unquoted()`. Kconfig frontends usually have ".config" as the default name for the configuration file. However, placing the configuration file in the source diff --git a/docs/markdown/snippets/keyval_kobject.md b/docs/markdown/snippets/keyval_kobject.md new file mode 100644 index 0000000..4add23c --- /dev/null +++ b/docs/markdown/snippets/keyval_kobject.md @@ -0,0 +1,6 @@ +## `unstable-kconfig` module renamed to `unstable-keyval` + +The `unstable-kconfig` module is now renamed to `unstable-keyval`. +We expect this module to become stable once it has some usage experience, +specifically in the next or the following release + diff --git a/docs/sitemap.txt b/docs/sitemap.txt index 3ac138e..4029a60 100644 --- a/docs/sitemap.txt +++ b/docs/sitemap.txt @@ -48,7 +48,7 @@ index.md SourceSet-module.md Windows-module.md Cuda-module.md - Kconfig-module.md + Keyval-module.md Java.md Vala.md D.md diff --git a/docs/theme/extra/templates/navbar_links.html b/docs/theme/extra/templates/navbar_links.html index 6980f81..832bd2c 100644 --- a/docs/theme/extra/templates/navbar_links.html +++ b/docs/theme/extra/templates/navbar_links.html @@ -14,7 +14,7 @@ ("Hotdoc-module.html","Hotdoc"), \ ("i18n-module.html","i18n"), \ ("Icestorm-module.html","Icestorm"), \ - ("Kconfig-module.html","kconfig"), \ + ("Keyval-module.html","Keyval"), \ ("Pkgconfig-module.html","Pkgconfig"), \ ("Python-module.html","Python"), \ ("Python-3-module.html","Python 3"), \ diff --git a/mesonbuild/modules/unstable_kconfig.py b/mesonbuild/modules/unstable_keyval.py index 6685710..3da2992 100644 --- a/mesonbuild/modules/unstable_kconfig.py +++ b/mesonbuild/modules/unstable_keyval.py @@ -21,9 +21,9 @@ from ..interpreter import InvalidCode import os -class KconfigModule(ExtensionModule): +class KeyvalModule(ExtensionModule): - @FeatureNew('Kconfig Module', '0.51.0') + @FeatureNew('Keyval Module', '0.55.0') def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.snippets.add('load') @@ -56,9 +56,7 @@ class KconfigModule(ExtensionModule): s = sources[0] is_built = False if isinstance(s, mesonlib.File): - if s.is_built: - FeatureNew('kconfig.load() of built files', '0.52.0').use(state.subproject) - is_built = True + is_built = is_built or s.is_built s = s.absolute_path(interpreter.environment.source_dir, interpreter.environment.build_dir) else: s = os.path.join(interpreter.environment.source_dir, s) @@ -70,4 +68,4 @@ class KconfigModule(ExtensionModule): def initialize(*args, **kwargs): - return KconfigModule(*args, **kwargs) + return KeyvalModule(*args, **kwargs) diff --git a/run_project_tests.py b/run_project_tests.py index 8cbf989..9da67b2 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -50,7 +50,7 @@ from run_tests import ensure_backend_detects_changes from run_tests import guess_backend ALL_TESTS = ['cmake', 'common', 'warning-meson', 'failing-meson', 'failing-build', 'failing-test', - 'kconfig', 'platform-osx', 'platform-windows', 'platform-linux', + 'keyval', 'platform-osx', 'platform-windows', 'platform-linux', 'java', 'C#', 'vala', 'rust', 'd', 'objective c', 'objective c++', 'fortran', 'swift', 'cuda', 'python3', 'python', 'fpga', 'frameworks', 'nasm', 'wasm' ] @@ -845,7 +845,7 @@ def detect_tests_to_run(only: T.List[str], use_tmp: bool) -> T.List[T.Tuple[str, ('failing-meson', 'failing', False), ('failing-build', 'failing build', False), ('failing-test', 'failing test', False), - ('kconfig', 'kconfig', False), + ('keyval', 'keyval', False), ('platform-osx', 'osx', not mesonlib.is_osx()), ('platform-windows', 'windows', not mesonlib.is_windows() and not mesonlib.is_cygwin()), diff --git a/test cases/common/222 source set realistic example/meson.build b/test cases/common/222 source set realistic example/meson.build index 5b0e495..106b81d 100644 --- a/test cases/common/222 source set realistic example/meson.build +++ b/test cases/common/222 source set realistic example/meson.build @@ -1,4 +1,4 @@ -# a sort-of realistic example that combines the sourceset and kconfig +# a sort-of realistic example that combines the sourceset and keyval # modules, inspired by QEMU's build system project('sourceset-example', 'cpp', default_options: ['cpp_std=c++11']) @@ -9,7 +9,7 @@ if cppid == 'pgi' endif ss = import('sourceset') -kconfig = import('unstable-kconfig') +keyval = import('unstable-keyval') zlib = declare_dependency(compile_args: '-DZLIB=1') another = declare_dependency(compile_args: '-DANOTHER=1') @@ -39,7 +39,7 @@ targets = [ 'arm', 'aarch64', 'x86' ] target_dirs = { 'arm' : 'arm', 'aarch64' : 'arm', 'x86': 'x86' } foreach x : targets - config = kconfig.load('config' / x) + config = keyval.load('config' / x) target_specific = specific.apply(config, strict: false) target_common = common.apply(config, strict: false) target_deps = target_specific.dependencies() + target_common.dependencies() diff --git a/test cases/kconfig/1 basic/.config b/test cases/keyval/1 basic/.config index 071d185..071d185 100644 --- a/test cases/kconfig/1 basic/.config +++ b/test cases/keyval/1 basic/.config diff --git a/test cases/kconfig/1 basic/meson.build b/test cases/keyval/1 basic/meson.build index 5dc8d19..fc7ddb3 100644 --- a/test cases/kconfig/1 basic/meson.build +++ b/test cases/keyval/1 basic/meson.build @@ -1,6 +1,6 @@ -project('kconfig basic test') +project('keyval basic test') -k = import('unstable-kconfig') +k = import('unstable-keyval') conf = k.load('.config') if not conf.has_key('CONFIG_VAL1') diff --git a/test cases/kconfig/2 subdir/.config b/test cases/keyval/2 subdir/.config index 0599d46..0599d46 100644 --- a/test cases/kconfig/2 subdir/.config +++ b/test cases/keyval/2 subdir/.config diff --git a/test cases/kconfig/2 subdir/dir/meson.build b/test cases/keyval/2 subdir/dir/meson.build index 12f1502..dc1b478 100644 --- a/test cases/kconfig/2 subdir/dir/meson.build +++ b/test cases/keyval/2 subdir/dir/meson.build @@ -1,5 +1,5 @@ -k = import('unstable-kconfig') +k = import('unstable-keyval') conf = k.load(meson.source_root() / '.config') diff --git a/test cases/kconfig/3 load_config files/meson.build b/test cases/keyval/2 subdir/meson.build index 1245b18..0651acf 100644 --- a/test cases/kconfig/3 load_config files/meson.build +++ b/test cases/keyval/2 subdir/meson.build @@ -1,4 +1,4 @@ -project('kconfig subdir test') +project('keyval subdir test') # Test into sub directory subdir('dir') diff --git a/test cases/kconfig/3 load_config files/dir/config b/test cases/keyval/3 load_config files/dir/config index 0599d46..0599d46 100644 --- a/test cases/kconfig/3 load_config files/dir/config +++ b/test cases/keyval/3 load_config files/dir/config diff --git a/test cases/kconfig/3 load_config files/dir/meson.build b/test cases/keyval/3 load_config files/dir/meson.build index d7b8d44..43fba13 100644 --- a/test cases/kconfig/3 load_config files/dir/meson.build +++ b/test cases/keyval/3 load_config files/dir/meson.build @@ -1,5 +1,5 @@ -k = import('unstable-kconfig') +k = import('unstable-keyval') conf = k.load(files('config')) diff --git a/test cases/kconfig/2 subdir/meson.build b/test cases/keyval/3 load_config files/meson.build index 1245b18..0651acf 100644 --- a/test cases/kconfig/2 subdir/meson.build +++ b/test cases/keyval/3 load_config files/meson.build @@ -1,4 +1,4 @@ -project('kconfig subdir test') +project('keyval subdir test') # Test into sub directory subdir('dir') diff --git a/test cases/kconfig/4 load_config builddir/config b/test cases/keyval/4 load_config builddir/config index 0599d46..0599d46 100644 --- a/test cases/kconfig/4 load_config builddir/config +++ b/test cases/keyval/4 load_config builddir/config diff --git a/test cases/kconfig/4 load_config builddir/meson.build b/test cases/keyval/4 load_config builddir/meson.build index 1924d23..1bb0285 100644 --- a/test cases/kconfig/4 load_config builddir/meson.build +++ b/test cases/keyval/4 load_config builddir/meson.build @@ -1,6 +1,6 @@ -project('kconfig builddir test') +project('keyval builddir test') -k = import('unstable-kconfig') +k = import('unstable-keyval') out_conf = configure_file(input: 'config', output: 'out-config', copy: true) conf = k.load(out_conf) |