From e673e6f053f7320f78a2ce9ed262f9c11e503998 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 6 Nov 2017 07:49:17 -0500 Subject: Tests: Pass generator instance into check for Fortran Check for a Fortran compiler using the same VS instance that we are testing. --- Tests/CheckFortran.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Tests/CheckFortran.cmake b/Tests/CheckFortran.cmake index b1652ba..653f521 100644 --- a/Tests/CheckFortran.cmake +++ b/Tests/CheckFortran.cmake @@ -15,11 +15,17 @@ file(WRITE \"\${CMAKE_CURRENT_BINARY_DIR}/result.cmake\" \"set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 \\\"\${CMAKE_Fortran_COMPILER_SUPPORTS_F90}\\\")\\n\" ) ") + if(CMAKE_GENERATOR_INSTANCE) + set(_D_CMAKE_GENERATOR_INSTANCE "-DCMAKE_GENERATOR_INSTANCE:INTERNAL=${CMAKE_GENERATOR_INSTANCE}") + else() + set(_D_CMAKE_GENERATOR_INSTANCE "") + endif() execute_process( WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/CheckFortran COMMAND ${CMAKE_COMMAND} . -G ${CMAKE_GENERATOR} -A "${CMAKE_GENERATOR_PLATFORM}" -T "${CMAKE_GENERATOR_TOOLSET}" + ${_D_CMAKE_GENERATOR_INSTANCE} OUTPUT_VARIABLE output ERROR_VARIABLE output RESULT_VARIABLE result -- cgit v0.12 From 6e2193a26dd3e73af41a86f672d84144beb5a3c9 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 6 Nov 2017 07:50:08 -0500 Subject: Tests: Avoid hanging on check for Fortran Use a timeout when running the check for Fortran in case the tools hang. --- Tests/CheckFortran.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/Tests/CheckFortran.cmake b/Tests/CheckFortran.cmake index 653f521..16a8ed2 100644 --- a/Tests/CheckFortran.cmake +++ b/Tests/CheckFortran.cmake @@ -26,6 +26,7 @@ file(WRITE \"\${CMAKE_CURRENT_BINARY_DIR}/result.cmake\" -A "${CMAKE_GENERATOR_PLATFORM}" -T "${CMAKE_GENERATOR_TOOLSET}" ${_D_CMAKE_GENERATOR_INSTANCE} + TIMEOUT 60 OUTPUT_VARIABLE output ERROR_VARIABLE output RESULT_VARIABLE result -- cgit v0.12