[cmake] When getting Ninja version, don't include CMakeNinjaFindMake

which doesn't play well with passing CMAKE_MAKE_PROGRAM from the
commandline without a path.

Fixes a bug introduced in r361280.

Thanks to Mikael Holmén for reporting this!

llvm-svn: 361501
This commit is contained in:
Don Hinton 2019-05-23 15:03:22 +00:00
parent 1312225f8c
commit 0857a4ec20
1 changed files with 5 additions and 8 deletions

View File

@ -555,14 +555,11 @@ set(LLVM_BINUTILS_INCDIR "" CACHE PATH
"PATH to binutils/include containing plugin-api.h for gold plugin.")
if(CMAKE_GENERATOR STREQUAL "Ninja")
include(CMakeNinjaFindMake OPTIONAL)
if(CMAKE_MAKE_PROGRAM)
execute_process(COMMAND ${CMAKE_MAKE_PROGRAM} --version
OUTPUT_VARIABLE NINJA_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(NINJA_VERSION ${NINJA_VERSION} CACHE STRING "Ninja version number" FORCE)
message(STATUS "Ninja version: ${NINJA_VERSION}")
endif()
execute_process(COMMAND ${CMAKE_MAKE_PROGRAM} --version
OUTPUT_VARIABLE NINJA_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(NINJA_VERSION ${NINJA_VERSION} CACHE STRING "Ninja version number" FORCE)
message(STATUS "Ninja version: ${NINJA_VERSION}")
endif()
if(CMAKE_GENERATOR STREQUAL "Ninja" AND