summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeTestCXXCompiler.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/CMakeTestCXXCompiler.cmake')
-rw-r--r--Modules/CMakeTestCXXCompiler.cmake12
1 files changed, 7 insertions, 5 deletions
diff --git a/Modules/CMakeTestCXXCompiler.cmake b/Modules/CMakeTestCXXCompiler.cmake
index 5609c96..4c227be 100644
--- a/Modules/CMakeTestCXXCompiler.cmake
+++ b/Modules/CMakeTestCXXCompiler.cmake
@@ -3,11 +3,13 @@
# and like the most basic of programs. If not, a fatel error
# is set and cmake stops processing commands and will not generate
# any makefiles or projects.
-MESSAGE(STATUS "Check for working CXX compiler: ${CMAKE_CXX_COMPILER}")
-WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeTmp/testCXXCompiler.cxx "int main(){return 0;}")
-TRY_COMPILE(CMAKE_CXX_COMPILER_WORKS ${CMAKE_BINARY_DIR}
- ${CMAKE_BINARY_DIR}/CMakeTmp/testCXXCompiler.cxx
- OUTPUT_VARIABLE OUTPUT)
+IF(NOT CMAKE_CXX_COMPILER_WORKS)
+ MESSAGE(STATUS "Check for working CXX compiler: ${CMAKE_CXX_COMPILER}")
+ WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeTmp/testCXXCompiler.cxx "int main(){return 0;}")
+ TRY_COMPILE(CMAKE_CXX_COMPILER_WORKS ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/CMakeTmp/testCXXCompiler.cxx
+ OUTPUT_VARIABLE OUTPUT)
+ENDIF(NOT CMAKE_CXX_COMPILER_WORKS)
IF(NOT CMAKE_CXX_COMPILER_WORKS)
MESSAGE(STATUS "Check for working CXX compiler: ${CMAKE_CXX_COMPILER} -- broken")
MESSAGE(FATAL_ERROR "The C++ compiler \"${CMAKE_CXX_COMPILER}\" "