From da516f0404bc60f2f9f3e9a59996c24f3a31db61 Mon Sep 17 00:00:00 2001 From: Orivej Desh Date: Sun, 3 Dec 2017 07:49:00 +0000 Subject: [PATCH] cmake: generate for Ninja when the build phase is Ninja This is overridable by providing a custom build phase or setting dontUseNinjaBuild = true. --- pkgs/development/tools/build-managers/cmake/setup-hook.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/development/tools/build-managers/cmake/setup-hook.sh b/pkgs/development/tools/build-managers/cmake/setup-hook.sh index 331f907ae612..37c067169dd4 100755 --- a/pkgs/development/tools/build-managers/cmake/setup-hook.sh +++ b/pkgs/development/tools/build-managers/cmake/setup-hook.sh @@ -51,6 +51,10 @@ cmakeConfigurePhase() { # And build always Release, to ensure optimisation flags cmakeFlags="-DCMAKE_BUILD_TYPE=${cmakeBuildType:-Release} -DCMAKE_SKIP_BUILD_RPATH=ON $cmakeFlags" + if [ "$buildPhase" = ninjaBuildPhase ]; then + cmakeFlags="-GNinja $cmakeFlags" + fi + echo "cmake flags: $cmakeFlags ${cmakeFlagsArray[@]}" cmake ${cmakeDir:-.} $cmakeFlags "${cmakeFlagsArray[@]}"