Skip to content

Commit 8a0fc0f

Browse files
authored
Set Ninja as default build tool and add --make flag to switch back (nasa#260)
* Set Ninja as default for fprime-util generate * Apply black formatter * fix argument for Ninja being the default
1 parent 6e1ace0 commit 8a0fc0f

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

.github/workflows/integration-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,18 @@ jobs:
4040
- name: Test generation and building on Ref
4141
working-directory: fprime/Ref
4242
run: |
43-
fprime-util generate
43+
fprime-util generate --make
4444
fprime-util build
4545
fprime-util hash-to-file 0x72ad3277
4646
- name: Test generation and building on Ref with Ninja
4747
working-directory: fprime/Ref
4848
run: |
49-
fprime-util generate --ninja --build-cache ./build-ninja
49+
fprime-util generate --build-cache ./build-ninja
5050
fprime-util build --build-cache ./build-ninja
5151
fprime-util hash-to-file 0x72ad3277 --build-cache ./build-ninja
5252
- name: Test special generation on Ref
5353
working-directory: fprime/Ref
5454
run: |
55-
fprime-util generate --build-cache ./special-cache --ut -DFPRIME_ENABLE_AUTOCODER_UTS=OFF
55+
fprime-util generate --make --build-cache ./special-cache --ut -DFPRIME_ENABLE_AUTOCODER_UTS=OFF
5656
fprime-util build --build-cache ./special-cache
5757
fprime-util hash-to-file 0x2ed4bda6 --build-cache ./special-cache

src/fprime/fbuild/cli.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
""" fprime.fbuild.cli: fbuild command line processing
1+
"""fprime.fbuild.cli: fbuild command line processing
22
33
Command line processing functions for fbuild (fprime build system targets) of "generate", "purge", and build system
44
target operations.
@@ -64,8 +64,14 @@ def run_fbuild_cli(
6464
cmake_args["ENABLE_SANITIZER_UNDEFINED_BEHAVIOR"] = "OFF"
6565
if toolchain is not None:
6666
cmake_args["CMAKE_TOOLCHAIN_FILE"] = toolchain
67-
if parsed.ninja:
67+
68+
if parsed.make:
69+
# No need to change CMAKE_GENERATOR since the default is Unix Makefiles
70+
pass
71+
else:
72+
# Sets Ninja as the default build system
6873
cmake_args["CMAKE_GENERATOR"] = "Ninja"
74+
6975
build.generate(cmake_args)
7076
elif parsed.command == "purge":
7177
# Since purge does not load its "base", we need to overload the platform
@@ -248,9 +254,9 @@ def add_special_targets(
248254
action="store_true",
249255
)
250256
generate_parser.add_argument(
251-
"--ninja",
257+
"--make",
252258
action="store_true",
253-
help="Use the Ninja build system instead of Unix Makefiles",
259+
help="Use the Unix Makefiles build system instead of Ninja",
254260
)
255261
# The following option is specified only to show up in --help.
256262
# It is not handled by argparse, but in fprime.util.cli:validate()

0 commit comments

Comments
 (0)