aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/markdown/IDE-integration.md3
-rw-r--r--mesonbuild/backend/backends.py8
-rw-r--r--mesonbuild/build.py15
3 files changed, 11 insertions, 15 deletions
diff --git a/docs/markdown/IDE-integration.md b/docs/markdown/IDE-integration.md
index 4b5c360..639f4a0 100644
--- a/docs/markdown/IDE-integration.md
+++ b/docs/markdown/IDE-integration.md
@@ -74,7 +74,8 @@ The following table shows all valid types for a target.
`shared library` | Target for a shared library
`shared module` | A shared library that is meant to be used with dlopen rather than linking into something else
`custom` | A custom target
- `unknown target` | The current target format is unknown. This is probably a bug
+ `run` | A Meson run target
+ `jar` | A Java JAR target
## Build Options
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index b3b6df9..0291e7e 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -1183,10 +1183,4 @@ class Backend:
'generated_sources': []
}]
- return [{
- 'language': 'unknown',
- 'compiler': [],
- 'parameters': [],
- 'sources': [],
- 'generated_sources': []
- }]
+ return []
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 642c2d5..5a243a4 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -345,7 +345,8 @@ a hard error in the future.''' % name)
self.install = False
self.build_always_stale = False
self.option_overrides = {}
- self.typename = 'unknown target'
+ if not hasattr(self, 'typename'):
+ raise RuntimeError('Target type is not set for target class "{}". This is a bug'.format(type(self).__name__))
def get_install_dir(self, environment):
# Find the installation directory.
@@ -1365,10 +1366,10 @@ class Executable(BuildTarget):
known_kwargs = known_exe_kwargs
def __init__(self, name, subdir, subproject, is_cross, sources, objects, environment, kwargs):
+ self.typename = 'executable'
if 'pie' not in kwargs and 'b_pie' in environment.coredata.base_options:
kwargs['pie'] = environment.coredata.base_options['b_pie'].value
super().__init__(name, subdir, subproject, is_cross, sources, objects, environment, kwargs)
- self.typename = 'executable'
# Unless overridden, executables have no suffix or prefix. Except on
# Windows and with C#/Mono executables where the suffix is 'exe'
if not hasattr(self, 'prefix'):
@@ -1455,10 +1456,10 @@ class StaticLibrary(BuildTarget):
known_kwargs = known_stlib_kwargs
def __init__(self, name, subdir, subproject, is_cross, sources, objects, environment, kwargs):
+ self.typename = 'static library'
if 'pic' not in kwargs and 'b_staticpic' in environment.coredata.base_options:
kwargs['pic'] = environment.coredata.base_options['b_staticpic'].value
super().__init__(name, subdir, subproject, is_cross, sources, objects, environment, kwargs)
- self.typename = 'static library'
if 'cs' in self.compilers:
raise InvalidArguments('Static libraries not supported for C#.')
if 'rust' in self.compilers:
@@ -1515,6 +1516,7 @@ class SharedLibrary(BuildTarget):
known_kwargs = known_shlib_kwargs
def __init__(self, name, subdir, subproject, is_cross, sources, objects, environment, kwargs):
+ self.typename = 'shared library'
self.soversion = None
self.ltversion = None
# Max length 2, first element is compatibility_version, second is current_version
@@ -1527,7 +1529,6 @@ class SharedLibrary(BuildTarget):
# The import library that GCC would generate (and prefer)
self.gcc_import_filename = None
super().__init__(name, subdir, subproject, is_cross, sources, objects, environment, kwargs)
- self.typename = 'shared library'
if 'rust' in self.compilers:
# If no crate type is specified, or it's the generic lib type, use dylib
if not hasattr(self, 'rust_crate_type') or self.rust_crate_type == 'lib':
@@ -1850,8 +1851,8 @@ class CustomTarget(Target):
])
def __init__(self, name, subdir, subproject, kwargs, absolute_paths=False):
- super().__init__(name, subdir, subproject, False)
self.typename = 'custom'
+ super().__init__(name, subdir, subproject, False)
self.dependencies = []
self.extra_depends = []
self.depend_files = [] # Files that this target depends on but are not on the command line.
@@ -2092,8 +2093,8 @@ class CustomTarget(Target):
class RunTarget(Target):
def __init__(self, name, command, args, dependencies, subdir, subproject):
- super().__init__(name, subdir, subproject, False)
self.typename = 'run'
+ super().__init__(name, subdir, subproject, False)
self.command = command
self.args = args
self.dependencies = dependencies
@@ -2130,6 +2131,7 @@ class Jar(BuildTarget):
known_kwargs = known_jar_kwargs
def __init__(self, name, subdir, subproject, is_cross, sources, objects, environment, kwargs):
+ self.typename = 'jar'
super().__init__(name, subdir, subproject, is_cross, sources, objects, environment, kwargs)
for s in self.sources:
if not s.endswith('.java'):
@@ -2137,7 +2139,6 @@ class Jar(BuildTarget):
for t in self.link_targets:
if not isinstance(t, Jar):
raise InvalidArguments('Link target %s is not a jar target.' % t)
- self.typename = 'jar'
self.filename = self.name + '.jar'
self.outputs = [self.filename]
self.java_args = kwargs.get('java_args', [])