aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mcompile.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/mcompile.py')
-rw-r--r--mesonbuild/mcompile.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/mesonbuild/mcompile.py b/mesonbuild/mcompile.py
index ce002bd..8179784 100644
--- a/mesonbuild/mcompile.py
+++ b/mesonbuild/mcompile.py
@@ -89,6 +89,7 @@ class ParsedTargetName:
'shared_library',
'shared_module',
'custom',
+ 'alias',
'run',
'jar',
}
@@ -130,7 +131,7 @@ def get_target_from_intro_data(target: ParsedTargetName, builddir: Path, introsp
def generate_target_names_ninja(target: ParsedTargetName, builddir: Path, introspect_data: dict) -> T.List[str]:
intro_target = get_target_from_intro_data(target, builddir, introspect_data)
- if intro_target['type'] == 'run':
+ if intro_target['type'] in {'alias', 'run'}:
return [target.name]
else:
return [str(Path(out_file).relative_to(builddir.resolve())) for out_file in intro_target['filename']]
@@ -169,7 +170,7 @@ def get_parsed_args_ninja(options: 'argparse.Namespace', builddir: Path) -> T.Tu
def generate_target_name_vs(target: ParsedTargetName, builddir: Path, introspect_data: dict) -> str:
intro_target = get_target_from_intro_data(target, builddir, introspect_data)
- assert intro_target['type'] != 'run', 'Should not reach here: `run` targets must be handle above'
+ assert intro_target['type'] not in {'alias', 'run'}, 'Should not reach here: `run` targets must be handle above'
# Normalize project name
# Source: https://docs.microsoft.com/en-us/visualstudio/msbuild/how-to-build-specific-targets-in-solutions-by-using-msbuild-exe
@@ -189,7 +190,7 @@ def get_parsed_args_vs(options: 'argparse.Namespace', builddir: Path) -> T.Tuple
if options.targets:
intro_data = parse_introspect_data(builddir)
has_run_target = any(
- get_target_from_intro_data(ParsedTargetName(t), builddir, intro_data)['type'] == 'run'
+ get_target_from_intro_data(ParsedTargetName(t), builddir, intro_data)['type'] in {'alias', 'run'}
for t in options.targets)
if has_run_target: