aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/unstable_kconfig.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/modules/unstable_kconfig.py')
-rw-r--r--mesonbuild/modules/unstable_kconfig.py13
1 files changed, 7 insertions, 6 deletions
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)