Skip to content

Commit

Permalink
Update CMake arg handling
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-bc committed Sep 25, 2023
1 parent f037f4a commit fe8f7f2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/fprime/fbuild/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,12 @@ def add_special_targets(
help="Disable the compiler sanitizers. Sanitizers are only enabled by default when --ut is provided.",
action="store_true",
)
# The following option is specified only to show up in --help.
# It is not handled by , in fprime.util.cli:validate()
generate_parser.add_argument(
"-Dxyz",
action="append",
help="Pass -D flags through to CMakes",
nargs=1,
default=[],
"-D<VAR>=<VALUE>",
action="store_true",
help="Pass -D flags through to CMake. Can be used multiple times.",
)
purge_parser = subparsers.add_parser(
"purge",
Expand Down
4 changes: 2 additions & 2 deletions src/fprime/util/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ def validate(parsed, unknown):
:param unknown: unknown arguments
:return: cmake arguments to pass to CMake
"""
# regex pattern to detect -D<CMAKE_ARGUMENT>=<VALUE> arguments for CMake
CMAKE_REG = re.compile(r"-D([a-zA-Z0-9_]+)=(.*)")
# regex pattern to detect -D<CMAKE_ARGUMENT>[:<TYPE>]=<VALUE> arguments for CMake
CMAKE_REG = re.compile(r"-D([a-zA-Z0-9_]+(?::[A-Z]+)?)=(.*)")
cmake_args = {}
make_args = {}
# Check platforms for existing toolchain, unless the default is specified.
Expand Down

0 comments on commit fe8f7f2

Please sign in to comment.