aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2019-07-24 11:30:35 +0400
committerJussi Pakkanen <jpakkane@gmail.com>2019-07-31 21:42:24 +0300
commit06aaffa4e14322274fe28184d159adec1142b1cb (patch)
treec5dc412201bbb42635b840f0d94ecafa2b9d9d3b /mesonbuild
parent679ddb0ae780bfd4d81c586b0512255c0d1e24b6 (diff)
downloadmeson-06aaffa4e14322274fe28184d159adec1142b1cb.zip
meson-06aaffa4e14322274fe28184d159adec1142b1cb.tar.gz
meson-06aaffa4e14322274fe28184d159adec1142b1cb.tar.bz2
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.
Diffstat (limited to 'mesonbuild')
-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)