|
|
|
@ -80,6 +80,7 @@ from .type_checking import ( |
|
|
|
|
INSTALL_TAG_KW, |
|
|
|
|
LANGUAGE_KW, |
|
|
|
|
NATIVE_KW, |
|
|
|
|
OVERRIDE_OPTIONS_KW, |
|
|
|
|
PRESERVE_PATH_KW, |
|
|
|
|
REQUIRED_KW, |
|
|
|
|
SOURCES_KW, |
|
|
|
@ -890,7 +891,7 @@ class Interpreter(InterpreterBase, HoldableObject): |
|
|
|
|
mlog.log('Subproject', mlog.bold(subp_name), ':', 'skipped: feature', mlog.bold(feature), 'disabled') |
|
|
|
|
return self.disabled_subproject(subp_name, disabled_feature=feature) |
|
|
|
|
|
|
|
|
|
default_options = coredata.create_options_dict(kwargs['default_options'], subp_name) |
|
|
|
|
default_options = {k.evolve(subproject=subp_name): v for k, v in kwargs['default_options'].items()} |
|
|
|
|
|
|
|
|
|
if subp_name == '': |
|
|
|
|
raise InterpreterException('Subproject name must not be empty.') |
|
|
|
@ -1196,13 +1197,17 @@ class Interpreter(InterpreterBase, HoldableObject): |
|
|
|
|
self.coredata.update_project_options(oi.options) |
|
|
|
|
self.add_build_def_file(option_file) |
|
|
|
|
|
|
|
|
|
if self.subproject: |
|
|
|
|
self.project_default_options = {k.evolve(subproject=self.subproject): v |
|
|
|
|
for k, v in kwargs['default_options'].items()} |
|
|
|
|
else: |
|
|
|
|
self.project_default_options = kwargs['default_options'] |
|
|
|
|
|
|
|
|
|
# Do not set default_options on reconfigure otherwise it would override |
|
|
|
|
# values previously set from command line. That means that changing |
|
|
|
|
# default_options in a project will trigger a reconfigure but won't |
|
|
|
|
# have any effect. |
|
|
|
|
self.project_default_options = coredata.create_options_dict( |
|
|
|
|
kwargs['default_options'], self.subproject) |
|
|
|
|
|
|
|
|
|
# |
|
|
|
|
# If this is the first invocation we always need to initialize |
|
|
|
|
# builtins, if this is a subproject that is new in a re-invocation we |
|
|
|
|
# need to initialize builtins for that |
|
|
|
@ -1694,7 +1699,7 @@ class Interpreter(InterpreterBase, HoldableObject): |
|
|
|
|
mlog.bold(' '.join(args))) |
|
|
|
|
sp_kwargs: kwtypes.DoSubproject = { |
|
|
|
|
'required': required, |
|
|
|
|
'default_options': [], |
|
|
|
|
'default_options': {}, |
|
|
|
|
'version': [], |
|
|
|
|
'cmake_options': [], |
|
|
|
|
'options': None, |
|
|
|
@ -1739,10 +1744,10 @@ class Interpreter(InterpreterBase, HoldableObject): |
|
|
|
|
@FeatureNewKwargs('dependency', '0.50.0', ['not_found_message', 'cmake_module_path', 'cmake_args']) |
|
|
|
|
@FeatureNewKwargs('dependency', '0.49.0', ['disabler']) |
|
|
|
|
@FeatureNewKwargs('dependency', '0.40.0', ['method']) |
|
|
|
|
@FeatureNewKwargs('dependency', '0.38.0', ['default_options']) |
|
|
|
|
@disablerIfNotFound |
|
|
|
|
@permittedKwargs(permitted_dependency_kwargs) |
|
|
|
|
@typed_pos_args('dependency', varargs=str, min_varargs=1) |
|
|
|
|
@typed_kwargs('dependency', DEFAULT_OPTIONS.evolve(since='0.38.0'), allow_unknown=True) |
|
|
|
|
def func_dependency(self, node: mparser.BaseNode, args: T.Tuple[T.List[str]], kwargs) -> Dependency: |
|
|
|
|
# Replace '' by empty list of names |
|
|
|
|
names = [n for n in args[0] if n] |
|
|
|
@ -1794,6 +1799,7 @@ class Interpreter(InterpreterBase, HoldableObject): |
|
|
|
|
@FeatureDeprecatedKwargs('executable', '0.56.0', ['gui_app'], extra_message="Use 'win_subsystem' instead.") |
|
|
|
|
@permittedKwargs(build.known_exe_kwargs) |
|
|
|
|
@typed_pos_args('executable', str, varargs=(str, mesonlib.File, build.CustomTarget, build.CustomTargetIndex, build.GeneratedList, build.StructuredSources, build.ExtractedObjects, build.BuildTarget)) |
|
|
|
|
@typed_kwargs('executable', OVERRIDE_OPTIONS_KW, allow_unknown=True) |
|
|
|
|
def func_executable(self, node: mparser.BaseNode, |
|
|
|
|
args: T.Tuple[str, T.List[BuildTargetSource]], |
|
|
|
|
kwargs) -> build.Executable: |
|
|
|
@ -1801,6 +1807,7 @@ class Interpreter(InterpreterBase, HoldableObject): |
|
|
|
|
|
|
|
|
|
@permittedKwargs(build.known_stlib_kwargs) |
|
|
|
|
@typed_pos_args('static_library', str, varargs=(str, mesonlib.File, build.CustomTarget, build.CustomTargetIndex, build.GeneratedList, build.StructuredSources, build.ExtractedObjects, build.BuildTarget)) |
|
|
|
|
@typed_kwargs('static_library', OVERRIDE_OPTIONS_KW, allow_unknown=True) |
|
|
|
|
def func_static_lib(self, node: mparser.BaseNode, |
|
|
|
|
args: T.Tuple[str, T.List[BuildTargetSource]], |
|
|
|
|
kwargs) -> build.StaticLibrary: |
|
|
|
@ -1808,6 +1815,7 @@ class Interpreter(InterpreterBase, HoldableObject): |
|
|
|
|
|
|
|
|
|
@permittedKwargs(build.known_shlib_kwargs) |
|
|
|
|
@typed_pos_args('shared_library', str, varargs=(str, mesonlib.File, build.CustomTarget, build.CustomTargetIndex, build.GeneratedList, build.StructuredSources, build.ExtractedObjects, build.BuildTarget)) |
|
|
|
|
@typed_kwargs('shared_library', OVERRIDE_OPTIONS_KW, allow_unknown=True) |
|
|
|
|
def func_shared_lib(self, node: mparser.BaseNode, |
|
|
|
|
args: T.Tuple[str, T.List[BuildTargetSource]], |
|
|
|
|
kwargs) -> build.SharedLibrary: |
|
|
|
@ -1817,6 +1825,7 @@ class Interpreter(InterpreterBase, HoldableObject): |
|
|
|
|
|
|
|
|
|
@permittedKwargs(known_library_kwargs) |
|
|
|
|
@typed_pos_args('both_libraries', str, varargs=(str, mesonlib.File, build.CustomTarget, build.CustomTargetIndex, build.GeneratedList, build.StructuredSources, build.ExtractedObjects, build.BuildTarget)) |
|
|
|
|
@typed_kwargs('both_libraries', OVERRIDE_OPTIONS_KW, allow_unknown=True) |
|
|
|
|
def func_both_lib(self, node: mparser.BaseNode, |
|
|
|
|
args: T.Tuple[str, T.List[BuildTargetSource]], |
|
|
|
|
kwargs) -> build.BothLibraries: |
|
|
|
@ -1825,6 +1834,7 @@ class Interpreter(InterpreterBase, HoldableObject): |
|
|
|
|
@FeatureNew('shared_module', '0.37.0') |
|
|
|
|
@permittedKwargs(build.known_shmod_kwargs) |
|
|
|
|
@typed_pos_args('shared_module', str, varargs=(str, mesonlib.File, build.CustomTarget, build.CustomTargetIndex, build.GeneratedList, build.StructuredSources, build.ExtractedObjects, build.BuildTarget)) |
|
|
|
|
@typed_kwargs('shared_module', OVERRIDE_OPTIONS_KW, allow_unknown=True) |
|
|
|
|
def func_shared_module(self, node: mparser.BaseNode, |
|
|
|
|
args: T.Tuple[str, T.List[BuildTargetSource]], |
|
|
|
|
kwargs) -> build.SharedModule: |
|
|
|
@ -1832,6 +1842,7 @@ class Interpreter(InterpreterBase, HoldableObject): |
|
|
|
|
|
|
|
|
|
@permittedKwargs(known_library_kwargs) |
|
|
|
|
@typed_pos_args('library', str, varargs=(str, mesonlib.File, build.CustomTarget, build.CustomTargetIndex, build.GeneratedList, build.StructuredSources, build.ExtractedObjects, build.BuildTarget)) |
|
|
|
|
@typed_kwargs('library', OVERRIDE_OPTIONS_KW, allow_unknown=True) |
|
|
|
|
def func_library(self, node: mparser.BaseNode, |
|
|
|
|
args: T.Tuple[str, T.List[BuildTargetSource]], |
|
|
|
|
kwargs) -> build.Executable: |
|
|
|
@ -1839,6 +1850,7 @@ class Interpreter(InterpreterBase, HoldableObject): |
|
|
|
|
|
|
|
|
|
@permittedKwargs(build.known_jar_kwargs) |
|
|
|
|
@typed_pos_args('jar', str, varargs=(str, mesonlib.File, build.CustomTarget, build.CustomTargetIndex, build.GeneratedList, build.ExtractedObjects, build.BuildTarget)) |
|
|
|
|
@typed_kwargs('jar', OVERRIDE_OPTIONS_KW, allow_unknown=True) |
|
|
|
|
def func_jar(self, node: mparser.BaseNode, |
|
|
|
|
args: T.Tuple[str, T.List[T.Union[str, mesonlib.File, build.GeneratedTypes]]], |
|
|
|
|
kwargs) -> build.Jar: |
|
|
|
@ -1847,6 +1859,7 @@ class Interpreter(InterpreterBase, HoldableObject): |
|
|
|
|
@FeatureNewKwargs('build_target', '0.40.0', ['link_whole', 'override_options']) |
|
|
|
|
@permittedKwargs(known_build_target_kwargs) |
|
|
|
|
@typed_pos_args('build_target', str, varargs=(str, mesonlib.File, build.CustomTarget, build.CustomTargetIndex, build.GeneratedList, build.StructuredSources, build.ExtractedObjects, build.BuildTarget)) |
|
|
|
|
@typed_kwargs('build_target', OVERRIDE_OPTIONS_KW, allow_unknown=True) |
|
|
|
|
def func_build_target(self, node: mparser.BaseNode, |
|
|
|
|
args: T.Tuple[str, T.List[BuildTargetSource]], |
|
|
|
|
kwargs) -> T.Union[build.Executable, build.StaticLibrary, build.SharedLibrary, |
|
|
|
|