mirror of https://github.com/ARMmbed/mbed-os.git
Remove deprecated flags args
The tools will no longer accept `--cflags`, `--cppflags`, or `--ldflags`. Instead, the ability to modify these flags is provided by the `--profile` argument. Documentation for the `--profile` argument may be found in docs/Toolchain_Profiles.mdpull/3467/head
parent
dc3252b61a
commit
333aad6191
|
@ -22,7 +22,12 @@ from tools.toolchains import TOOLCHAINS
|
||||||
from tools.targets import TARGET_NAMES
|
from tools.targets import TARGET_NAMES
|
||||||
from tools.utils import argparse_force_uppercase_type, \
|
from tools.utils import argparse_force_uppercase_type, \
|
||||||
argparse_lowercase_hyphen_type, argparse_many, \
|
argparse_lowercase_hyphen_type, argparse_many, \
|
||||||
argparse_filestring_type, args_error, argparse_profile_filestring_type
|
argparse_filestring_type, args_error, argparse_profile_filestring_type,\
|
||||||
|
argparse_deprecate
|
||||||
|
|
||||||
|
FLAGS_DEPRECATION_MESSAGE = "Please use the --profile argument instead.\n"\
|
||||||
|
"Documentation may be found in "\
|
||||||
|
"docs/Toolchain_Profiles.md"
|
||||||
|
|
||||||
def get_default_options_parser(add_clean=True, add_options=True,
|
def get_default_options_parser(add_clean=True, add_options=True,
|
||||||
add_app_config=False):
|
add_app_config=False):
|
||||||
|
@ -59,14 +64,17 @@ def get_default_options_parser(add_clean=True, add_options=True,
|
||||||
help="print Warnings, and Errors in color",
|
help="print Warnings, and Errors in color",
|
||||||
action="store_true", default=False)
|
action="store_true", default=False)
|
||||||
|
|
||||||
parser.add_argument("--cflags", default=[], action="append",
|
parser.add_argument("--cflags",
|
||||||
help="Extra flags to provide to the C compiler")
|
type=argparse_deprecate(FLAGS_DEPRECATION_MESSAGE),
|
||||||
|
help="Deprecated. " + FLAGS_DEPRECATION_MESSAGE)
|
||||||
|
|
||||||
parser.add_argument("--asmflags", default=[], action="append",
|
parser.add_argument("--asmflags",
|
||||||
help="Extra flags to provide to the assembler")
|
type=argparse_deprecate(FLAGS_DEPRECATION_MESSAGE),
|
||||||
|
help="Deprecated. " + FLAGS_DEPRECATION_MESSAGE)
|
||||||
|
|
||||||
parser.add_argument("--ldflags", default=[], action="append",
|
parser.add_argument("--ldflags",
|
||||||
help="Extra flags to provide to the linker")
|
type=argparse_deprecate(FLAGS_DEPRECATION_MESSAGE),
|
||||||
|
help="Deprecated. " + FLAGS_DEPRECATION_MESSAGE)
|
||||||
|
|
||||||
if add_clean:
|
if add_clean:
|
||||||
parser.add_argument("-c", "--clean", action="store_true", default=False,
|
parser.add_argument("-c", "--clean", action="store_true", default=False,
|
||||||
|
|
|
@ -488,6 +488,13 @@ def argparse_dir_not_parent(other):
|
||||||
return not_parent
|
return not_parent
|
||||||
return parse_type
|
return parse_type
|
||||||
|
|
||||||
|
def argparse_deprecate(replacement_message):
|
||||||
|
"""fail if argument is provided with deprecation warning"""
|
||||||
|
def parse_type(_):
|
||||||
|
"""The parser type"""
|
||||||
|
raise argparse.ArgumentTypeError("Deprecated." + replacement_message)
|
||||||
|
return parse_type
|
||||||
|
|
||||||
def print_large_string(large_string):
|
def print_large_string(large_string):
|
||||||
""" Breaks a string up into smaller pieces before print them
|
""" Breaks a string up into smaller pieces before print them
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue