aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2022-12-19 12:33:32 +0100
committerDylan Baker <dylan@pnwbakers.com>2023-01-04 09:44:32 -0800
commitb3fc3cd6b5193dc750843530b13358a772ffdd7d (patch)
tree9301e2ee047dbdae6c0a5db62d479a791ab4cacd /mesonbuild
parent8d2940024bd16919bf7772334dd0048604abecfb (diff)
downloadmeson-b3fc3cd6b5193dc750843530b13358a772ffdd7d.zip
meson-b3fc3cd6b5193dc750843530b13358a772ffdd7d.tar.gz
meson-b3fc3cd6b5193dc750843530b13358a772ffdd7d.tar.bz2
add objects keyword argument to declare_dependencies
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/build.py3
-rw-r--r--mesonbuild/dependencies/base.py9
-rw-r--r--mesonbuild/interpreter/interpreter.py5
-rw-r--r--mesonbuild/modules/external_project.py2
-rw-r--r--mesonbuild/modules/gnome.py2
5 files changed, 13 insertions, 8 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 9d55bf9..960101f 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -1294,6 +1294,7 @@ class BuildTarget(Target):
# Those parts that are internal.
self.process_sourcelist(dep.sources)
self.add_include_dirs(dep.include_directories, dep.get_include_type())
+ self.objects.extend(dep.objects)
for l in dep.libraries:
self.link(l)
for l in dep.whole_libraries:
@@ -1304,7 +1305,7 @@ class BuildTarget(Target):
[],
dep.get_compile_args(),
dep.get_link_args(),
- [], [], [], [], {}, [], [])
+ [], [], [], [], {}, [], [], [])
self.external_deps.append(extpart)
# Deps of deps.
self.add_deps(dep.ext_deps)
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py
index d826026..7e997c0 100644
--- a/mesonbuild/dependencies/base.py
+++ b/mesonbuild/dependencies/base.py
@@ -31,13 +31,12 @@ from ..mesonlib import version_compare_many
if T.TYPE_CHECKING:
from .._typing import ImmutableListProtocol
- from ..build import StructuredSources
from ..compilers.compilers import Compiler
from ..environment import Environment
from ..interpreterbase import FeatureCheckBase
from ..build import (
CustomTarget, IncludeDirs, CustomTargetIndex, LibTypes,
- StaticLibrary
+ StaticLibrary, StructuredSources, ExtractedObjects
)
from ..mesonlib import FileOrString
@@ -252,7 +251,8 @@ class InternalDependency(Dependency):
whole_libraries: T.List[T.Union[StaticLibrary, CustomTarget, CustomTargetIndex]],
sources: T.Sequence[T.Union[FileOrString, CustomTarget, StructuredSources]],
ext_deps: T.List[Dependency], variables: T.Dict[str, str],
- d_module_versions: T.List[T.Union[str, int]], d_import_dirs: T.List['IncludeDirs']):
+ d_module_versions: T.List[T.Union[str, int]], d_import_dirs: T.List['IncludeDirs'],
+ objects: T.List['ExtractedObjects']):
super().__init__(DependencyTypeName('internal'), {})
self.version = version
self.is_found = True
@@ -264,6 +264,7 @@ class InternalDependency(Dependency):
self.sources = list(sources)
self.ext_deps = ext_deps
self.variables = variables
+ self.objects = objects
if d_module_versions:
self.d_features['versions'] = d_module_versions
if d_import_dirs:
@@ -315,7 +316,7 @@ class InternalDependency(Dependency):
return InternalDependency(
self.version, final_includes, final_compile_args,
final_link_args, final_libraries, final_whole_libraries,
- final_sources, final_deps, self.variables, [], [])
+ final_sources, final_deps, self.variables, [], [], [])
def get_include_dirs(self) -> T.List['IncludeDirs']:
return self.include_directories
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py
index 92d58aa..1dd07a2 100644
--- a/mesonbuild/interpreter/interpreter.py
+++ b/mesonbuild/interpreter/interpreter.py
@@ -670,12 +670,14 @@ class Interpreter(InterpreterBase, HoldableObject):
SOURCES_KW,
VARIABLES_KW.evolve(since='0.54.0', since_values={list: '0.56.0'}),
KwargInfo('version', (str, NoneType)),
+ KwargInfo('objects', ContainerTypeInfo(list, build.ExtractedObjects), listify=True, default=[], since='1.1.0'),
)
def func_declare_dependency(self, node, args, kwargs):
deps = kwargs['dependencies']
incs = self.extract_incdirs(kwargs)
libs = kwargs['link_with']
libs_whole = kwargs['link_whole']
+ objects = kwargs['objects']
sources = self.source_strings_to_files(kwargs['sources'])
compile_args = kwargs['compile_args']
link_args = kwargs['link_args']
@@ -703,7 +705,8 @@ class Interpreter(InterpreterBase, HoldableObject):
dep = dependencies.InternalDependency(version, incs, compile_args,
link_args, libs, libs_whole, sources, deps,
- variables, d_module_versions, d_import_dirs)
+ variables, d_module_versions, d_import_dirs,
+ objects)
return dep
@typed_pos_args('assert', bool, optargs=[str])
diff --git a/mesonbuild/modules/external_project.py b/mesonbuild/modules/external_project.py
index c3b01c8..d296052 100644
--- a/mesonbuild/modules/external_project.py
+++ b/mesonbuild/modules/external_project.py
@@ -269,7 +269,7 @@ class ExternalProject(NewExtensionModule):
link_args = [f'-L{abs_libdir}', f'-l{libname}']
sources = self.target
dep = InternalDependency(version, [], compile_args, link_args, [],
- [], [sources], [], {}, [], [])
+ [], [sources], [], {}, [], [], [])
return dep
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index 0cb5f53..b5de7b7 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -2153,7 +2153,7 @@ class GnomeModule(ExtensionModule):
# - add relevant directories to include dirs
incs = [build.IncludeDirs(state.subdir, ['.'] + vapi_includes, False)]
sources = [vapi_target] + vapi_depends
- rv = InternalDependency(None, incs, [], [], link_with, [], sources, [], {}, [], [])
+ rv = InternalDependency(None, incs, [], [], link_with, [], sources, [], {}, [], [], [])
created_values.append(rv)
return ModuleReturnValue(rv, created_values)