aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2022-11-02 16:01:42 -0400
committerNirbheek Chauhan <nirbheek@centricular.com>2022-11-21 15:43:52 +0530
commitffafb99821215b23ddc75a5db426ef19650d5b42 (patch)
treee57e81ae763119878dabd30cf7609bcf3aa701cf
parent7d50b3a1871a77bbb833af565bb18620e09f730f (diff)
downloadmeson-ffafb99821215b23ddc75a5db426ef19650d5b42.zip
meson-ffafb99821215b23ddc75a5db426ef19650d5b42.tar.gz
meson-ffafb99821215b23ddc75a5db426ef19650d5b42.tar.bz2
hotdoc module: add dedicated depends kwarg, deprecate file deps in dependencies
We consistently use the "dependencies" kwarg to refer to C-like CFLAGS/LDFLAGS interfaces. And for hotdoc, we actually accept libraries for this as well, as we may want to document their (generated?) sources, so we want their CFLAGS too. But we also accepted custom targets and just added a build order dependency on these, which was odd and typically we call that "depends". Let's deprecate this in favor of the depends kwarg.
-rw-r--r--mesonbuild/modules/hotdoc.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/mesonbuild/modules/hotdoc.py b/mesonbuild/modules/hotdoc.py
index 06eec2a..800f766 100644
--- a/mesonbuild/modules/hotdoc.py
+++ b/mesonbuild/modules/hotdoc.py
@@ -23,7 +23,10 @@ from mesonbuild.coredata import MesonException
from . import ModuleReturnValue, ModuleInfo
from . import ExtensionModule
from ..dependencies import Dependency, InternalDependency
-from ..interpreterbase import InvalidArguments, noPosargs, noKwargs, typed_kwargs, ContainerTypeInfo, KwargInfo, typed_pos_args
+from ..interpreterbase import (
+ InvalidArguments, noPosargs, noKwargs, typed_kwargs, FeatureDeprecated,
+ ContainerTypeInfo, KwargInfo, typed_pos_args
+)
from ..interpreter import CustomTargetHolder
from ..interpreter.type_checking import NoneType
from ..programs import ExternalProgram
@@ -290,6 +293,7 @@ class HotdocTargetBuilder:
self.process_extra_assets()
self.add_extension_paths(self.kwargs.pop('extra_extension_paths'))
self.process_subprojects()
+ self.extra_depends.extend(self.kwargs.pop('depends'))
install = self.kwargs.pop('install')
self.process_extra_args()
@@ -415,10 +419,18 @@ class HotDocModule(ExtensionModule):
# --c-include-directories
KwargInfo(
'dependencies',
- ContainerTypeInfo(list, (Dependency, build.StaticLibrary, build.SharedLibrary)),
+ ContainerTypeInfo(list, (Dependency, build.StaticLibrary, build.SharedLibrary,
+ build.CustomTarget, build.CustomTargetIndex)),
listify=True,
default=[],
),
+ KwargInfo(
+ 'depends',
+ ContainerTypeInfo(list, (build.CustomTarget, build.CustomTargetIndex)),
+ listify=True,
+ default=[],
+ since='0.64.1',
+ ),
KwargInfo('gi_c_source_roots', ContainerTypeInfo(list, str), listify=True, default=[]),
KwargInfo('extra_assets', ContainerTypeInfo(list, str), listify=True, default=[]),
KwargInfo('extra_extension_paths', ContainerTypeInfo(list, str), listify=True, default=[]),
@@ -428,6 +440,9 @@ class HotDocModule(ExtensionModule):
)
def generate_doc(self, state, args, kwargs):
project_name = args[0]
+ if any(isinstance(x, (build.CustomTarget, build.CustomTargetIndex)) for x in kwargs['dependencies']):
+ FeatureDeprecated.single_use('hotdoc.generate_doc dependencies argument with custom_target',
+ '0.64.1', state.subproject, 'use `depends`', state.current_node)
builder = HotdocTargetBuilder(project_name, state, self.hotdoc, self.interpreter, kwargs)
target, install_script = builder.make_targets()
targets = [target]