summaryrefslogtreecommitdiffstats
path: root/Modules/CheckCSourceRuns.cmake
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@fb.com>2018-02-16 07:03:51 (GMT)
committerBrad King <brad.king@kitware.com>2018-02-16 14:51:26 (GMT)
commitb25b39ad76d4e0f03ff0d4b833de45fdde68b096 (patch)
tree087ee2a27fb04bde26206dfe9280f8c8fdd6d4c7 /Modules/CheckCSourceRuns.cmake
parent269722ae5b458c6e925c35fdebf5c8f35b3a182c (diff)
downloadCMake-b25b39ad76d4e0f03ff0d4b833de45fdde68b096.zip
CMake-b25b39ad76d4e0f03ff0d4b833de45fdde68b096.tar.gz
CMake-b25b39ad76d4e0f03ff0d4b833de45fdde68b096.tar.bz2
CheckCSourceRuns: Teach CHECK_C_SOURCE_RUNS to log run output
Signed-off-by: Edward Z. Yang <ezyang@fb.com> Fixes: #17745
Diffstat (limited to 'Modules/CheckCSourceRuns.cmake')
-rw-r--r--Modules/CheckCSourceRuns.cmake11
1 files changed, 8 insertions, 3 deletions
diff --git a/Modules/CheckCSourceRuns.cmake b/Modules/CheckCSourceRuns.cmake
index fa51346..7eb050c 100644
--- a/Modules/CheckCSourceRuns.cmake
+++ b/Modules/CheckCSourceRuns.cmake
@@ -92,7 +92,8 @@ macro(CHECK_C_SOURCE_RUNS SOURCE VAR)
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
-DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH}
"${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
- COMPILE_OUTPUT_VARIABLE OUTPUT)
+ COMPILE_OUTPUT_VARIABLE OUTPUT
+ RUN_OUTPUT_VARIABLE RUN_OUTPUT)
# if it did not compile make the return value fail code of 1
if(NOT ${VAR}_COMPILED)
set(${VAR}_EXITCODE 1)
@@ -104,8 +105,10 @@ macro(CHECK_C_SOURCE_RUNS SOURCE VAR)
message(STATUS "Performing Test ${VAR} - Success")
endif()
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
- "Performing C SOURCE FILE Test ${VAR} succeeded with the following output:\n"
+ "Performing C SOURCE FILE Test ${VAR} succeeded with the following compile output:\n"
"${OUTPUT}\n"
+ "...and run output:\n"
+ "${RUN_OUTPUT}\n"
"Return value: ${${VAR}}\n"
"Source file was:\n${SOURCE}\n")
else()
@@ -119,8 +122,10 @@ macro(CHECK_C_SOURCE_RUNS SOURCE VAR)
message(STATUS "Performing Test ${VAR} - Failed")
endif()
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
- "Performing C SOURCE FILE Test ${VAR} failed with the following output:\n"
+ "Performing C SOURCE FILE Test ${VAR} failed with the following compile output:\n"
"${OUTPUT}\n"
+ "...and run output:\n"
+ "${RUN_OUTPUT}\n"
"Return value: ${${VAR}_EXITCODE}\n"
"Source file was:\n${SOURCE}\n")