sanitycheck: Default to using Ninja
It is important that it is easy to reproduce CI issues locally. Using
the same sanitycheck options locally and in CI helps in this
regard. Specifically, Ninja and Make can produce different results and
therefore the default generator should be the same for sanitycheck and
shippable.
This patch makes four changes:
The sanitycheck option '--make' is introduced to allow specifying Make
as a generator.
CI no longer passes the option '--ninja' to sanitycheck.
Sanitycheck defaults to using Ninja.
Sanitycheck documents the --ninja option as deprecated.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
diff --git a/scripts/sanitycheck b/scripts/sanitycheck
index fc1a86b..f0253cb 100755
--- a/scripts/sanitycheck
+++ b/scripts/sanitycheck
@@ -828,14 +828,14 @@
if not "native_posix" in args:
ldflags="-Wl,--fatal-warnings"
- if options.ninja:
- generator = "Ninja"
- generator_cmd = "ninja"
- verb = "-v" if VERBOSE else ""
- else:
+ if options.make:
generator = "Unix Makefiles"
generator_cmd = "$(MAKE)"
verb = "VERBOSE=1" if VERBOSE else "VERBOSE=0"
+ else:
+ generator = "Ninja"
+ generator_cmd = "ninja"
+ verb = "-v" if VERBOSE else ""
return MakeGenerator.MAKE_RULE_TMPL.format(
generator=generator,
@@ -2092,7 +2092,12 @@
parser.add_argument(
"-N", "--ninja", action="store_true",
- help="Use the Ninja generator with CMake")
+ help="Use the Ninja generator with CMake. "
+ "This option is deprecated as Ninja is now the default.")
+
+ parser.add_argument(
+ "-M", "--make", action="store_true",
+ help="Use the 'Unix Makefiles' generator with CMake")
parser.add_argument(
"-y", "--dry-run", action="store_true",