This website requires JavaScript.
Explore
Help
Sign In
kolan
/
CMake
Watch
1
Star
0
Fork
You've already forked CMake
0
Code
Issues
Pull Requests
Releases
Wiki
Activity
b4678e1c34
CMake
/
Tests
/
TryCompile
/
exit_success.c
8 lines
74 B
C
Raw
Normal View
History
Unescape
Escape
ENH: improve TRY_RUN() for crosscompiling: instead of just failing, it now creates two cache variables, one for the RUN_RESULT, one for the RUN_OUTPUT (if required), which can be set or preset by the user. It has now also two new arguments: RUN_OUTPUT_VARIABLE and COMPILE_OUTPUT_VARIABLE (the old OUTPUT_VARIABLE merges both), so if only COMPILE_OUTPUT_VARIABLE is used the run time output of the TRY_RUN is unused and the user doesn't have to care about the output when crosscompiling. This is now used in FindThreads.cmake, CheckC/CXXSourceRuns.cmake and TestBigEndian.cmake, which used the output only for the logfile (compile output is still there). Test/TryCompile/ now also tests the behaviour of OUTPUT_VARIABLE, RUN_OUTPUT_VARIABLE and COMPILE_OUTPUT_VARIABLE. Alex
2007-06-01 19:16:29 +04:00
#
include
<stdio.h>
ENH: add two simple tests for TRY_RUN() STYLE: create a new base class cmCoreTryCompile, from which cmTryCompileCommand and cmTryRunCommand are derived, so there are no public static functions with lots of arguments anymore Alex
2007-05-24 19:27:51 +04:00
int
main
(
)
{
ENH: improve TRY_RUN() for crosscompiling: instead of just failing, it now creates two cache variables, one for the RUN_RESULT, one for the RUN_OUTPUT (if required), which can be set or preset by the user. It has now also two new arguments: RUN_OUTPUT_VARIABLE and COMPILE_OUTPUT_VARIABLE (the old OUTPUT_VARIABLE merges both), so if only COMPILE_OUTPUT_VARIABLE is used the run time output of the TRY_RUN is unused and the user doesn't have to care about the output when crosscompiling. This is now used in FindThreads.cmake, CheckC/CXXSourceRuns.cmake and TestBigEndian.cmake, which used the output only for the logfile (compile output is still there). Test/TryCompile/ now also tests the behaviour of OUTPUT_VARIABLE, RUN_OUTPUT_VARIABLE and COMPILE_OUTPUT_VARIABLE. Alex
2007-06-01 19:16:29 +04:00
printf
(
"
hello world
\n
"
)
;
ENH: add two simple tests for TRY_RUN() STYLE: create a new base class cmCoreTryCompile, from which cmTryCompileCommand and cmTryRunCommand are derived, so there are no public static functions with lots of arguments anymore Alex
2007-05-24 19:27:51 +04:00
return
0
;
}