summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2010-08-19 17:26:07 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2010-08-19 17:26:07 (GMT)
commit8ccfc5e24d424a6d4de40c2626f359561ea35c9b (patch)
tree4570f6d175d47c80255774821c0db5ffb4ab4384
parent9487612590743ace84f7801ff7a8d31518550d96 (diff)
parente6c9bc267b6037e66447561b546e3ba25369140a (diff)
downloadCMake-8ccfc5e24d424a6d4de40c2626f359561ea35c9b.zip
CMake-8ccfc5e24d424a6d4de40c2626f359561ea35c9b.tar.gz
CMake-8ccfc5e24d424a6d4de40c2626f359561ea35c9b.tar.bz2
Merge topic 'TimeoutForExecuteProcessInVendorChecking'
e6c9bc2 Add timeout to execute_process() in CMAKE_DETERMINE_COMPILER_ID().
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake13
1 files changed, 10 insertions, 3 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index 5fc2238..bf78a5b 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -283,6 +283,7 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang)
WORKING_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR}
OUTPUT_VARIABLE output ERROR_VARIABLE output
RESULT_VARIABLE result
+ TIMEOUT 10
)
IF("${output}" MATCHES "${regex}")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
@@ -291,9 +292,15 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang)
SET(CMAKE_${lang}_COMPILER_ID "${vendor}" PARENT_SCOPE)
BREAK()
ELSE()
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
- "Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" "
- "did not match \"${regex}\":\n${output}")
+ 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()
+ FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ "Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" "
+ "did not match \"${regex}\":\n${output}")
+ ENDIF()
ENDIF()
ENDFOREACH()
ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_VENDOR)