Removed two deprecations from 2016.

pull/2947/head
Jussi Pakkanen 7 years ago
parent b06b8c6452
commit 59d0434039
  1. 14
      docs/markdown/snippets/deprecations.md
  2. 15
      mesonbuild/interpreter.py
  3. 3
      test cases/common/58 run target/meson.build
  4. 2
      test cases/common/90 identical target name in subproject/meson.build
  5. 2
      test cases/common/90 identical target name in subproject/subprojects/foo/meson.build

@ -0,0 +1,14 @@
## Removed two deprecated features
The standalone `find_library` function has been a no-op for a long
time. Starting with this version it becomes a hard error.
There used to be a keywordless version of `run_target` which looked
like this:
run_target('targetname', 'command', 'arg1', 'arg2')
This is now an error. The correct format for this is now:
run_target('targetname',
command : ['command', 'arg1', 'arg2'])

@ -1,4 +1,4 @@
# Copyright 2012-2017 The Meson development team
# Copyright 2012-2018 The Meson development team
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@ -36,8 +36,6 @@ from collections import namedtuple
import importlib
run_depr_printed = False
def stringifyUserArguments(args):
if isinstance(args, list):
return '[%s]' % ', '.join([stringifyUserArguments(x) for x in args])
@ -2138,7 +2136,7 @@ to directly access options of other subprojects.''')
return progobj
def func_find_library(self, node, args, kwargs):
mlog.log(mlog.red('DEPRECATION:'), 'find_library() is removed, use the corresponding method in compiler object instead.')
raise InvalidCode('find_library() is removed, use the corresponding method in a compiler object instead.')
def _find_cached_dep(self, name, kwargs):
# Check if we want this as a cross-dep or a native-dep
@ -2447,15 +2445,8 @@ root and issuing %s.
@permittedKwargs(permitted_kwargs['run_target'])
def func_run_target(self, node, args, kwargs):
global run_depr_printed
if len(args) > 1:
if not run_depr_printed:
mlog.log(mlog.red('DEPRECATION'), 'positional version of run_target is deprecated, use the keyword version instead.')
run_depr_printed = True
if 'command' in kwargs:
raise InterpreterException('Can not have command both in positional and keyword arguments.')
all_args = args[1:]
deps = []
raise InvalidCode('Run_target takes only one positional argument: the target name.')
elif len(args) == 1:
if 'command' not in kwargs:
raise InterpreterException('Missing "command" keyword argument')

@ -1,8 +1,5 @@
project('run target', 'c')
# deprecated format, fix once we remove support for it.
run_target('mycommand','scripts/script.sh')
# Make it possible to run built programs.
# In cross builds exe_wrapper should be added if it exists.

@ -3,4 +3,4 @@ project('toplevel bar', 'c')
subproject('foo')
executable('bar', 'bar.c')
run_target('nop', 'true')
run_target('nop', command : ['true'])

@ -1,4 +1,4 @@
project('subfoo', 'c')
executable('bar', 'bar.c')
run_target('nop', 'true')
run_target('nop', command : ['true'])

Loading…
Cancel
Save