CMakeDetermineCompilerId: Do not test vendor without a compiler

If no CMAKE_${lang}_COMPILER is available then do not try to run
it to determine the compiler vendor.
This commit is contained in:
Brad King 2013-10-22 13:59:56 -04:00
parent ddef8a7cff
commit 18a253732d
1 changed files with 1 additions and 1 deletions

View File

@ -44,7 +44,7 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
endforeach()
# If the compiler is still unknown, try to query its vendor.
if(NOT CMAKE_${lang}_COMPILER_ID)
if(CMAKE_${lang}_COMPILER AND NOT CMAKE_${lang}_COMPILER_ID)
CMAKE_DETERMINE_COMPILER_ID_VENDOR(${lang})
endif()