|
|
|
@ -1418,71 +1418,17 @@ class MesonMain(InterpreterObject): |
|
|
|
|
raise InterpreterException('Unknown cross property: %s.' % propname) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pch_kwargs = set(['c_pch', 'cpp_pch']) |
|
|
|
|
|
|
|
|
|
lang_arg_kwargs = set([ |
|
|
|
|
'c_args', |
|
|
|
|
'cpp_args', |
|
|
|
|
'd_args', |
|
|
|
|
'd_import_dirs', |
|
|
|
|
'd_unittest', |
|
|
|
|
'd_module_versions', |
|
|
|
|
'fortran_args', |
|
|
|
|
'java_args', |
|
|
|
|
'objc_args', |
|
|
|
|
'objcpp_args', |
|
|
|
|
'rust_args', |
|
|
|
|
'vala_args', |
|
|
|
|
'cs_args', |
|
|
|
|
]) |
|
|
|
|
|
|
|
|
|
vala_kwargs = set(['vala_header', 'vala_gir', 'vala_vapi']) |
|
|
|
|
rust_kwargs = set(['rust_crate_type']) |
|
|
|
|
cs_kwargs = set(['resources', 'cs_args']) |
|
|
|
|
|
|
|
|
|
buildtarget_kwargs = set([ |
|
|
|
|
'build_by_default', |
|
|
|
|
'build_rpath', |
|
|
|
|
'dependencies', |
|
|
|
|
'extra_files', |
|
|
|
|
'gui_app', |
|
|
|
|
'link_with', |
|
|
|
|
'link_whole', |
|
|
|
|
'link_args', |
|
|
|
|
'link_depends', |
|
|
|
|
'implicit_include_directories', |
|
|
|
|
'include_directories', |
|
|
|
|
'install', |
|
|
|
|
'install_rpath', |
|
|
|
|
'install_dir', |
|
|
|
|
'name_prefix', |
|
|
|
|
'name_suffix', |
|
|
|
|
'native', |
|
|
|
|
'objects', |
|
|
|
|
'override_options', |
|
|
|
|
'pic', |
|
|
|
|
'sources', |
|
|
|
|
'vs_module_defs', |
|
|
|
|
]) |
|
|
|
|
|
|
|
|
|
build_target_common_kwargs = ( |
|
|
|
|
buildtarget_kwargs | |
|
|
|
|
lang_arg_kwargs | |
|
|
|
|
pch_kwargs | |
|
|
|
|
vala_kwargs | |
|
|
|
|
rust_kwargs | |
|
|
|
|
cs_kwargs) |
|
|
|
|
|
|
|
|
|
exe_kwargs = (build_target_common_kwargs) | {'implib', 'export_dynamic'} |
|
|
|
|
shlib_kwargs = (build_target_common_kwargs) | {'version', 'soversion'} |
|
|
|
|
shmod_kwargs = shlib_kwargs |
|
|
|
|
stlib_kwargs = shlib_kwargs |
|
|
|
|
|
|
|
|
|
jar_kwargs = exe_kwargs.copy() |
|
|
|
|
jar_kwargs.update(['main_class']) |
|
|
|
|
|
|
|
|
|
build_target_kwargs = exe_kwargs.copy() |
|
|
|
|
build_target_kwargs.update(['target_type']) |
|
|
|
|
known_library_kwargs = ( |
|
|
|
|
build.known_shlib_kwargs | |
|
|
|
|
build.known_stlib_kwargs |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
known_build_target_kwargs = ( |
|
|
|
|
known_library_kwargs | |
|
|
|
|
build.known_exe_kwargs | |
|
|
|
|
build.known_jar_kwargs | |
|
|
|
|
{'target_type'} |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
permitted_kwargs = {'add_global_arguments': {'language'}, |
|
|
|
|
'add_global_link_arguments': {'language'}, |
|
|
|
@ -1491,12 +1437,12 @@ permitted_kwargs = {'add_global_arguments': {'language'}, |
|
|
|
|
'add_project_arguments': {'language'}, |
|
|
|
|
'add_test_setup': {'exe_wrapper', 'gdb', 'timeout_multiplier', 'env'}, |
|
|
|
|
'benchmark': {'args', 'env', 'should_fail', 'timeout', 'workdir', 'suite'}, |
|
|
|
|
'build_target': build_target_kwargs, |
|
|
|
|
'build_target': known_build_target_kwargs, |
|
|
|
|
'configure_file': {'input', 'output', 'configuration', 'command', 'install_dir', 'capture', 'install'}, |
|
|
|
|
'custom_target': {'input', 'output', 'command', 'install', 'install_dir', 'build_always', 'capture', 'depends', 'depend_files', 'depfile', 'build_by_default'}, |
|
|
|
|
'dependency': {'default_options', 'fallback', 'language', 'main', 'method', 'modules', 'optional_modules', 'native', 'required', 'static', 'version'}, |
|
|
|
|
'declare_dependency': {'include_directories', 'link_with', 'sources', 'dependencies', 'compile_args', 'link_args', 'link_whole', 'version'}, |
|
|
|
|
'executable': exe_kwargs, |
|
|
|
|
'executable': build.known_exe_kwargs, |
|
|
|
|
'find_program': {'required', 'native'}, |
|
|
|
|
'generator': {'arguments', 'output', 'depfile', 'capture', 'preserve_path_from'}, |
|
|
|
|
'include_directories': {'is_system'}, |
|
|
|
@ -1504,12 +1450,13 @@ permitted_kwargs = {'add_global_arguments': {'language'}, |
|
|
|
|
'install_headers': {'install_dir', 'subdir'}, |
|
|
|
|
'install_man': {'install_dir'}, |
|
|
|
|
'install_subdir': {'exclude_files', 'exclude_directories', 'install_dir', 'install_mode', 'strip_directory'}, |
|
|
|
|
'jar': jar_kwargs, |
|
|
|
|
'jar': build.known_jar_kwargs, |
|
|
|
|
'project': {'version', 'meson_version', 'default_options', 'license', 'subproject_dir'}, |
|
|
|
|
'run_target': {'command', 'depends'}, |
|
|
|
|
'shared_library': shlib_kwargs, |
|
|
|
|
'shared_module': shmod_kwargs, |
|
|
|
|
'static_library': stlib_kwargs, |
|
|
|
|
'shared_library': build.known_shlib_kwargs, |
|
|
|
|
'shared_module': build.known_shmod_kwargs, |
|
|
|
|
'static_library': build.known_stlib_kwargs, |
|
|
|
|
'library': known_library_kwargs, |
|
|
|
|
'subdir': {'if_found'}, |
|
|
|
|
'subproject': {'version', 'default_options'}, |
|
|
|
|
'test': {'args', 'env', 'is_parallel', 'should_fail', 'timeout', 'workdir', 'suite'}, |
|
|
|
@ -2545,14 +2492,12 @@ root and issuing %s. |
|
|
|
|
def func_shared_module(self, node, args, kwargs): |
|
|
|
|
return self.build_target(node, args, kwargs, SharedModuleHolder) |
|
|
|
|
|
|
|
|
|
@permittedKwargs(permitted_kwargs['library']) |
|
|
|
|
def func_library(self, node, args, kwargs): |
|
|
|
|
if self.coredata.get_builtin_option('default_library') == 'shared': |
|
|
|
|
return self.func_shared_lib(node, args, kwargs) |
|
|
|
|
return self.func_static_lib(node, args, kwargs) |
|
|
|
|
return self.build_library(node, args, kwargs) |
|
|
|
|
|
|
|
|
|
@permittedKwargs(permitted_kwargs['jar']) |
|
|
|
|
def func_jar(self, node, args, kwargs): |
|
|
|
|
kwargs['target_type'] = 'jar' |
|
|
|
|
return self.build_target(node, args, kwargs, JarHolder) |
|
|
|
|
|
|
|
|
|
@permittedKwargs(permitted_kwargs['build_target']) |
|
|
|
@ -2561,15 +2506,15 @@ root and issuing %s. |
|
|
|
|
raise InterpreterException('Missing target_type keyword argument') |
|
|
|
|
target_type = kwargs.pop('target_type') |
|
|
|
|
if target_type == 'executable': |
|
|
|
|
return self.func_executable(node, args, kwargs) |
|
|
|
|
return self.build_target(node, args, kwargs, ExecutableHolder) |
|
|
|
|
elif target_type == 'shared_library': |
|
|
|
|
return self.func_shared_lib(node, args, kwargs) |
|
|
|
|
return self.build_target(node, args, kwargs, SharedLibraryHolder) |
|
|
|
|
elif target_type == 'static_library': |
|
|
|
|
return self.func_static_lib(node, args, kwargs) |
|
|
|
|
return self.build_target(node, args, kwargs, StaticLibraryHolder) |
|
|
|
|
elif target_type == 'library': |
|
|
|
|
return self.func_library(node, args, kwargs) |
|
|
|
|
return self.build_library(node, args, kwargs) |
|
|
|
|
elif target_type == 'jar': |
|
|
|
|
return self.func_jar(node, args, kwargs) |
|
|
|
|
return self.build_target(node, args, kwargs, JarHolder) |
|
|
|
|
else: |
|
|
|
|
raise InterpreterException('Unknown target_type.') |
|
|
|
|
|
|
|
|
@ -3222,6 +3167,11 @@ different subdirectory. |
|
|
|
|
if idname not in self.coredata.target_guids: |
|
|
|
|
self.coredata.target_guids[idname] = str(uuid.uuid4()).upper() |
|
|
|
|
|
|
|
|
|
def build_library(self, node, args, kwargs): |
|
|
|
|
if self.coredata.get_builtin_option('default_library') == 'shared': |
|
|
|
|
return self.build_target(node, args, kwargs, SharedLibraryHolder) |
|
|
|
|
return self.build_target(node, args, kwargs, StaticLibraryHolder) |
|
|
|
|
|
|
|
|
|
def build_target(self, node, args, kwargs, targetholder): |
|
|
|
|
if not args: |
|
|
|
|
raise InterpreterException('Target does not have a name.') |
|
|
|
@ -3257,7 +3207,13 @@ different subdirectory. |
|
|
|
|
mlog.debug('Unknown target type:', str(targetholder)) |
|
|
|
|
raise RuntimeError('Unreachable code') |
|
|
|
|
self.kwarg_strings_to_includedirs(kwargs) |
|
|
|
|
|
|
|
|
|
# Filter out kwargs from other target types. For example 'soversion' |
|
|
|
|
# passed to library() when default_library == 'static'. |
|
|
|
|
kwargs = {k: v for k, v in kwargs.items() if k in targetclass.known_kwargs} |
|
|
|
|
|
|
|
|
|
target = targetclass(name, self.subdir, self.subproject, is_cross, sources, objs, self.environment, kwargs) |
|
|
|
|
|
|
|
|
|
if is_cross: |
|
|
|
|
self.add_cross_stdlib_info(target) |
|
|
|
|
l = targetholder(target, self) |
|
|
|
|