Skip to content

Commit

Permalink
add kflags for C and C++
Browse files Browse the repository at this point in the history
  • Loading branch information
biojppm committed May 14, 2024
1 parent 6740c86 commit 957c246
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/c4/cmany/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions src/c4/cmany/build_flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']

Expand Down

0 comments on commit 957c246

Please sign in to comment.