summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeTestCCompiler.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-12-15 13:29:43 (GMT)
committerBrad King <brad.king@kitware.com>2011-12-15 13:31:17 (GMT)
commit5f6985ac869150e468f8ad388bdbb8a39010cbb5 (patch)
treecb554f52fc600d8ff754d7073f761ee9c1432421 /Modules/CMakeTestCCompiler.cmake
parent4ed1769186f0622efced9d89e6593d136c920dd2 (diff)
downloadCMake-5f6985ac869150e468f8ad388bdbb8a39010cbb5.zip
CMake-5f6985ac869150e468f8ad388bdbb8a39010cbb5.tar.gz
CMake-5f6985ac869150e468f8ad388bdbb8a39010cbb5.tar.bz2
Avoid clobbering variable 'OUTPUT' in compiler tests (#12628)
Use an obscure name and clean up afterwards.
Diffstat (limited to 'Modules/CMakeTestCCompiler.cmake')
-rw-r--r--Modules/CMakeTestCCompiler.cmake9
1 files changed, 5 insertions, 4 deletions
diff --git a/Modules/CMakeTestCCompiler.cmake b/Modules/CMakeTestCCompiler.cmake
index 4d4e35f..779b2f0 100644
--- a/Modules/CMakeTestCCompiler.cmake
+++ b/Modules/CMakeTestCCompiler.cmake
@@ -35,7 +35,7 @@ IF(NOT CMAKE_C_COMPILER_WORKS)
"{ (void)argv; return argc-1;}\n")
TRY_COMPILE(CMAKE_C_COMPILER_WORKS ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler.c
- OUTPUT_VARIABLE OUTPUT)
+ OUTPUT_VARIABLE __CMAKE_C_COMPILER_OUTPUT)
SET(C_TEST_WAS_RUN 1)
ENDIF(NOT CMAKE_C_COMPILER_WORKS)
@@ -43,7 +43,7 @@ IF(NOT CMAKE_C_COMPILER_WORKS)
PrintTestCompilerStatus("C" " -- broken")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the C compiler works failed with "
- "the following output:\n${OUTPUT}\n\n")
+ "the following output:\n${__CMAKE_C_COMPILER_OUTPUT}\n\n")
# if the compiler is broken make sure to remove the platform file
# since Windows-cl configures both c/cxx files both need to be removed
# when c or c++ fails
@@ -51,14 +51,14 @@ IF(NOT CMAKE_C_COMPILER_WORKS)
FILE(REMOVE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake )
MESSAGE(FATAL_ERROR "The C compiler \"${CMAKE_C_COMPILER}\" "
"is not able to compile a simple test program.\nIt fails "
- "with the following output:\n ${OUTPUT}\n\n"
+ "with the following output:\n ${__CMAKE_C_COMPILER_OUTPUT}\n\n"
"CMake will not be able to correctly generate this project.")
ELSE(NOT CMAKE_C_COMPILER_WORKS)
IF(C_TEST_WAS_RUN)
PrintTestCompilerStatus("C" " -- works")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the C compiler works passed with "
- "the following output:\n${OUTPUT}\n\n")
+ "the following output:\n${__CMAKE_C_COMPILER_OUTPUT}\n\n")
ENDIF(C_TEST_WAS_RUN)
SET(CMAKE_C_COMPILER_WORKS 1 CACHE INTERNAL "")
@@ -84,3 +84,4 @@ ELSE(NOT CMAKE_C_COMPILER_WORKS)
ENDIF()
ENDIF(NOT CMAKE_C_COMPILER_WORKS)
+UNSET(__CMAKE_C_COMPILER_OUTPUT)