From 102035373a48fddfa54f785168898d90343cf45a Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 12 Aug 2019 15:20:31 +0200 Subject: [PATCH] Build: automatically detect ninja build system when running "make" So that you don't have to specify "make ninja" every time. --- GNUmakefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 1ad7cc4fc27..2cd2c1a7443 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -230,11 +230,15 @@ endif # ----------------------------------------------------------------------------- # build tool -ifneq "$(findstring ninja, $(MAKECMDGOALS))" "" - BUILD_COMMAND:=ninja +ifeq "$(findstring ninja, $(MAKECMDGOALS))" "" BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -G Ninja + BUILD_COMMAND:=ninja else - BUILD_COMMAND:=make -s + ifneq ("$(wildcard $(BUILD_DIR)/build.ninja)","") + BUILD_COMMAND:=ninja + else + BUILD_COMMAND:=make -s + endif endif # -----------------------------------------------------------------------------