Merge topic 'TimeoutForExecuteProcessInVendorChecking'
e6c9bc2
Add timeout to execute_process() in CMAKE_DETERMINE_COMPILER_ID().
This commit is contained in:
commit
8ccfc5e24d
|
@ -283,6 +283,7 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang)
|
||||||
WORKING_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR}
|
WORKING_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR}
|
||||||
OUTPUT_VARIABLE output ERROR_VARIABLE output
|
OUTPUT_VARIABLE output ERROR_VARIABLE output
|
||||||
RESULT_VARIABLE result
|
RESULT_VARIABLE result
|
||||||
|
TIMEOUT 10
|
||||||
)
|
)
|
||||||
IF("${output}" MATCHES "${regex}")
|
IF("${output}" MATCHES "${regex}")
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||||
|
@ -290,10 +291,16 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang)
|
||||||
"matched \"${regex}\":\n${output}")
|
"matched \"${regex}\":\n${output}")
|
||||||
SET(CMAKE_${lang}_COMPILER_ID "${vendor}" PARENT_SCOPE)
|
SET(CMAKE_${lang}_COMPILER_ID "${vendor}" PARENT_SCOPE)
|
||||||
BREAK()
|
BREAK()
|
||||||
|
ELSE()
|
||||||
|
IF("${result}" MATCHES "timeout")
|
||||||
|
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||||
|
"Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" "
|
||||||
|
"terminated after 10 s due to timeout.")
|
||||||
ELSE()
|
ELSE()
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||||
"Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" "
|
"Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" "
|
||||||
"did not match \"${regex}\":\n${output}")
|
"did not match \"${regex}\":\n${output}")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
ENDFOREACH()
|
ENDFOREACH()
|
||||||
ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_VENDOR)
|
ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_VENDOR)
|
||||||
|
|
Loading…
Reference in New Issue