From b19913188d03d59332908f6280af37325bc49492 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Wed, 8 Jul 2020 12:42:39 +0200 Subject: [PATCH] [cmake] Use CMAKE_GENERATOR to determine if Ninja is used The name of the make program does not necessarily match "ninja", especially if an alternative implementation like samurai is used. Using CMAKE_GENERATOR is a more robust detection method, and is already used elsewhere in this file. Differential revision: https://reviews.llvm.org/D77091 --- llvm/cmake/modules/HandleLLVMOptions.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake index dfcf684..2e24959 100644 --- a/llvm/cmake/modules/HandleLLVMOptions.cmake +++ b/llvm/cmake/modules/HandleLLVMOptions.cmake @@ -27,7 +27,7 @@ string(TOUPPER "${LLVM_ENABLE_LTO}" uppercase_LLVM_ENABLE_LTO) set(LLVM_PARALLEL_COMPILE_JOBS "" CACHE STRING "Define the maximum number of concurrent compilation jobs (Ninja only).") if(LLVM_PARALLEL_COMPILE_JOBS) - if(NOT CMAKE_MAKE_PROGRAM MATCHES "ninja") + if(NOT CMAKE_GENERATOR STREQUAL "Ninja") message(WARNING "Job pooling is only available with Ninja generators.") else() set_property(GLOBAL APPEND PROPERTY JOB_POOLS compile_job_pool=${LLVM_PARALLEL_COMPILE_JOBS}) @@ -37,7 +37,7 @@ endif() set(LLVM_PARALLEL_LINK_JOBS "" CACHE STRING "Define the maximum number of concurrent link jobs (Ninja only).") -if(CMAKE_MAKE_PROGRAM MATCHES "ninja") +if(CMAKE_GENERATOR STREQUAL "Ninja") if(NOT LLVM_PARALLEL_LINK_JOBS AND uppercase_LLVM_ENABLE_LTO STREQUAL "THIN") message(STATUS "ThinLTO provides its own parallel linking - limiting parallel link jobs to 2.") set(LLVM_PARALLEL_LINK_JOBS "2") -- 2.7.4