summaryrefslogtreecommitdiff
path: root/Modules/CMakeTestCCompiler.cmake
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2006-07-26 11:46:22 -0400
committerAndy Cedilnik <andy.cedilnik@kitware.com>2006-07-26 11:46:22 -0400
commita9c0929d3938e432484cc2c3e44bf79167ed010d (patch)
treee9b9ebe3403518d16eb3cee89f32801828341e55 /Modules/CMakeTestCCompiler.cmake
parent47ef50453004e62510f5705185d912950e8fb68f (diff)
downloadcmake-a9c0929d3938e432484cc2c3e44bf79167ed010d.tar.gz
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 0beadd8a1e..9b9a51aaf3 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)