diff options
-rw-r--r-- | Modules/Platform/Windows-cl.cmake | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Modules/Platform/Windows-cl.cmake b/Modules/Platform/Windows-cl.cmake index 3c71c60..594029b 100644 --- a/Modules/Platform/Windows-cl.cmake +++ b/Modules/Platform/Windows-cl.cmake @@ -86,7 +86,11 @@ IF(CMAKE_GENERATOR MATCHES "Makefiles") "${CMAKE_ROOT}/Modules/CMakeTestNMakeCLVersion.c") STRING(REGEX REPLACE "/" "\\\\" testNmakeCLVersionFile "${testNmakeCLVersionFile}") MESSAGE(STATUS "Check for CL compiler version") - EXEC_PROGRAM(${CMAKE_C_COMPILER} + SET(CMAKE_TEST_COMPILER ${CMAKE_C_COMPILER}) + IF (NOT CMAKE_C_COMPILER) + SET(CMAKE_TEST_COMPILER ${CMAKE_CXX_COMPILER}) + ENDIF(NOT CMAKE_C_COMPILER) + EXEC_PROGRAM(${CMAKE_TEST_COMPILER} ARGS /nologo -EP \"${testNmakeCLVersionFile}\" OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT RETURN_VALUE CMAKE_COMPILER_RETURN @@ -139,7 +143,7 @@ IF(CMAKE_GENERATOR MATCHES "Makefiles") "${CMAKE_ROOT}/Modules/CMakeTestForFreeVC.cxx") STRING(REGEX REPLACE "/" "\\\\" testForFreeVCFile "${testForFreeVCFile}") MESSAGE(STATUS "Check if this is a free VC compiler") - EXEC_PROGRAM(${CMAKE_C_COMPILER} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp2 + EXEC_PROGRAM(${CMAKE_TEST_COMPILER} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp2 ARGS /nologo /MD /EHsc \"${testForFreeVCFile}\" OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT @@ -160,7 +164,7 @@ IF(CMAKE_GENERATOR MATCHES "Makefiles") ENDIF(CMAKE_COMPILER_RETURN) MAKE_DIRECTORY("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3") MESSAGE(STATUS "Check CL platform") - EXEC_PROGRAM(${CMAKE_C_COMPILER} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3 + EXEC_PROGRAM(${CMAKE_TEST_COMPILER} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3 ARGS /nologo \"${testForFreeVCFile}\" /link /machine:i386 |