diff --git a/src/c4/cmany/args.py b/src/c4/cmany/args.py index 4149140..c75d087 100644 --- a/src/c4/cmany/args.py +++ b/src/c4/cmany/args.py @@ -403,6 +403,8 @@ def add_cflags(parser): Multiple invokations of -D are possible, in which case arguments will be appended and not overwritten. To escape commas, use a backslash \\.""") + g.add_argument("-K", "--kflags", default=[], action=FlagArgument, + help="""Add C and C++ compiler flags. See -C and -X.""") g.add_argument("-X", "--cxxflags", default=[], action=FlagArgument, help="""Add C++ compiler flags. Accepts a comma-separated list of C++ compiler flags. diff --git a/src/c4/cmany/build_flags.py b/src/c4/cmany/build_flags.py index 5ba152c..3032260 100644 --- a/src/c4/cmany/build_flags.py +++ b/src/c4/cmany/build_flags.py @@ -17,6 +17,10 @@ def __init__(self, name, **kwargs): self.cflags = kwargs.get('cflags', []) self.cxxflags = kwargs.get('cxxflags', []) self.toolchain = kwargs.get('toolchain') + kflags = kwargs.get('kflags') + if kflags is not None: + self.cflags += kflags + self.cxxflags += kflags # self.include_dirs = kwargs['include_dirs'] # self.link_dirs = kwargs['link_dirs']