[llvm] r239069 - Fix the check for Ninja in the CMake build.

Evgeniy Stepanov eugeni.stepanov at gmail.com
Thu Jun 4 11:54:16 PDT 2015


Author: eugenis
Date: Thu Jun  4 13:54:16 2015
New Revision: 239069

URL: http://llvm.org/viewvc/llvm-project?rev=239069&view=rev
Log:
Fix the check for Ninja in the CMake build.

The current check never passes, because CMAKE_MAKE_PROGRAM, at least on Linux,
includes the full path to the "ninja" binary; this effectively disables
compile/link jobs pools.

Use CMAKE_GENERATOR STREQUAL "Ninja" as a more reliable check.

Modified:
    llvm/trunk/CMakeLists.txt

Modified: llvm/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/CMakeLists.txt?rev=239069&r1=239068&r2=239069&view=diff
==============================================================================
--- llvm/trunk/CMakeLists.txt (original)
+++ llvm/trunk/CMakeLists.txt Thu Jun  4 13:54:16 2015
@@ -32,7 +32,7 @@ project(LLVM)
 set(LLVM_PARALLEL_COMPILE_JOBS "" CACHE STRING
   "Define the maximum number of concurrent compilation jobs.")
 if(LLVM_PARALLEL_COMPILE_JOBS)
-  if(CMAKE_VERSION VERSION_LESS 3.0 OR NOT CMAKE_MAKE_PROGRAM STREQUAL "ninja")
+  if(CMAKE_VERSION VERSION_LESS 3.0 OR NOT CMAKE_GENERATOR STREQUAL "Ninja")
     message(WARNING "Job pooling is only available with Ninja generators and CMake 3.0 and later.")
   else()
     set_property(GLOBAL APPEND PROPERTY JOB_POOLS compile_job_pool=${LLVM_PARALLEL_COMPILE_JOBS})
@@ -43,7 +43,7 @@ endif()
 set(LLVM_PARALLEL_LINK_JOBS "" CACHE STRING
   "Define the maximum number of concurrent link jobs.")
 if(LLVM_PARALLEL_LINK_JOBS)
-  if(CMAKE_VERSION VERSION_LESS 3.0 OR NOT CMAKE_MAKE_PROGRAM STREQUAL "ninja")
+  if(CMAKE_VERSION VERSION_LESS 3.0 OR NOT CMAKE_GENERATOR STREQUAL "Ninja")
     message(WARNING "Job pooling is only available with Ninja generators and CMake 3.0 and later.")
   else()
     set_property(GLOBAL APPEND PROPERTY JOB_POOLS link_job_pool=${LLVM_PARALLEL_LINK_JOBS})





More information about the llvm-commits mailing list