[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.") "PATH to binutils/include containing plugin-api.h for gold plugin.")
if(CMAKE_GENERATOR STREQUAL "Ninja") if(CMAKE_GENERATOR STREQUAL "Ninja")
include(CMakeNinjaFindMake OPTIONAL) execute_process(COMMAND ${CMAKE_MAKE_PROGRAM} --version
if(CMAKE_MAKE_PROGRAM) OUTPUT_VARIABLE NINJA_VERSION
execute_process(COMMAND ${CMAKE_MAKE_PROGRAM} --version OUTPUT_STRIP_TRAILING_WHITESPACE)
OUTPUT_VARIABLE NINJA_VERSION set(NINJA_VERSION ${NINJA_VERSION} CACHE STRING "Ninja version number" FORCE)
OUTPUT_STRIP_TRAILING_WHITESPACE) message(STATUS "Ninja version: ${NINJA_VERSION}")
set(NINJA_VERSION ${NINJA_VERSION} CACHE STRING "Ninja version number" FORCE)
message(STATUS "Ninja version: ${NINJA_VERSION}")
endif()
endif() endif()
if(CMAKE_GENERATOR STREQUAL "Ninja" AND if(CMAKE_GENERATOR STREQUAL "Ninja" AND