summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeTestCCompiler.cmake
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2006-07-26 15:46:22 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2006-07-26 15:46:22 (GMT)
commita9c0929d3938e432484cc2c3e44bf79167ed010d (patch)
treee9b9ebe3403518d16eb3cee89f32801828341e55 /Modules/CMakeTestCCompiler.cmake
parent47ef50453004e62510f5705185d912950e8fb68f (diff)
downloadCMake-a9c0929d3938e432484cc2c3e44bf79167ed010d.zip
CMake-a9c0929d3938e432484cc2c3e44bf79167ed010d.tar.gz
CMake-a9c0929d3938e432484cc2c3e44bf79167ed010d.tar.bz2
COMP: Handle both ansi and non-ansi C
Diffstat (limited to 'Modules/CMakeTestCCompiler.cmake')
-rw-r--r--Modules/CMakeTestCCompiler.cmake3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/CMakeTestCCompiler.cmake b/Modules/CMakeTestCCompiler.cmake
index 0beadd8..9b9a51a 100644
--- a/Modules/CMakeTestCCompiler.cmake
+++ b/Modules/CMakeTestCCompiler.cmake
@@ -10,7 +10,8 @@ IF(NOT CMAKE_C_COMPILER_WORKS)
"#ifdef __cplusplus\n"
"# error \"The CMAKE_C_COMPILER is set to a C++ compiler\"\n"
"#endif\n"
- "int main(){return 0;}\n")
+ "#include <stdio.h>\n"
+ "int main(int argc, char* argv[]){ printf(\"%s\\n\", argv[0]); 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)