From 06aaffa4e14322274fe28184d159adec1142b1cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 24 Jul 2019 11:30:35 +0400 Subject: Allow kconfig to read from configure_file() At configure time, kconfig can read from configure_file(). "test cases/kconfig/4 load_config builddir/meson.build" was already showing a workaround, now it actually can take configure_file input directly. --- mesonbuild/modules/unstable_kconfig.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'mesonbuild') diff --git a/mesonbuild/modules/unstable_kconfig.py b/mesonbuild/modules/unstable_kconfig.py index 1639eed..6685710 100644 --- a/mesonbuild/modules/unstable_kconfig.py +++ b/mesonbuild/modules/unstable_kconfig.py @@ -54,15 +54,16 @@ class KconfigModule(ExtensionModule): raise InvalidCode('load takes only one file input.') s = sources[0] + is_built = False if isinstance(s, mesonlib.File): - # kconfig input is processed at "meson setup" time, not during - # the build, so it cannot reside in the build directory. if s.is_built: - raise InvalidCode('kconfig input must be a source file.') - s = s.relative_name() + FeatureNew('kconfig.load() of built files', '0.52.0').use(state.subproject) + is_built = True + s = s.absolute_path(interpreter.environment.source_dir, interpreter.environment.build_dir) + else: + s = os.path.join(interpreter.environment.source_dir, s) - s = os.path.join(interpreter.environment.source_dir, s) - if s not in interpreter.build_def_files: + if s not in interpreter.build_def_files and not is_built: interpreter.build_def_files.append(s) return self._load_file(s) -- cgit v1.1