Skip to content

Commit f8a3e55

Browse files
committed
Use ninja if installed for both macOS and Linux
Based on PR feedback, default to using Ninja for native builds on any Unix platform where ninja is installed, rather than only on macOS. This aligns with the Mono subtree behavior and provides faster builds when ninja is available.
1 parent c98f1b9 commit f8a3e55

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

eng/build.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ usage()
8484
echo " --gccx.y Optional argument to build using gcc version x.y."
8585
echo " --portablebuild Optional argument: set to false to force a non-portable build."
8686
echo " --keepnativesymbols Optional argument: set to true to keep native symbols/debuginfo in generated binaries."
87-
echo " --ninja Optional argument: use Ninja instead of Make (default: true on macOS, use --ninja false to disable)."
87+
echo " --ninja Optional argument: use Ninja instead of Make (default: true if ninja is installed, use --ninja false to disable)."
8888
echo " --pgoinstrument Optional argument: build PGO-instrumented runtime"
8989
echo " --fsanitize Optional argument: Specify native sanitizers to instrument the native build with. Supported values are: 'address'."
9090
echo ""
@@ -166,8 +166,8 @@ source $scriptroot/common/native/init-os-and-arch.sh
166166

167167
hostArch=$arch
168168

169-
# Default to using Ninja on macOS for faster builds (can be overridden with --ninja false)
170-
if [[ "$os" == "osx" ]]; then
169+
# Default to using Ninja if installed for faster builds (can be overridden with --ninja false)
170+
if command -v ninja &> /dev/null; then
171171
useNinja=true
172172
else
173173
useNinja=false

0 commit comments

Comments
 (0)