summaryrefslogtreecommitdiff
path: root/Modules/CMakeTestCCompiler.cmake
diff options
context:
space:
mode:
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)