diff options
author | Brad King <brad.king@kitware.com> | 2023-01-13 20:16:33 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-01-18 21:41:01 (GMT) |
commit | 0f688386eabafb1e70a172004df8be4d9dc1d037 (patch) | |
tree | 2c85a26300b9feed358ec65676a679c614921be9 /Modules/FindMPI.cmake | |
parent | ecc26f98eb713247f4b7a060fc69d7f4b665a1d8 (diff) | |
download | CMake-0f688386eabafb1e70a172004df8be4d9dc1d037.zip CMake-0f688386eabafb1e70a172004df8be4d9dc1d037.tar.gz CMake-0f688386eabafb1e70a172004df8be4d9dc1d037.tar.bz2 |
Modules: Drop redundant check logging to CMakeOutput.log and CMakeError.log
`try_compile` and `try_run` now automatically log checks using them to
`CMakeConfigureLog.yaml`.
Add `LOG_DESCRIPTION` arguments to some `try_compile` calls to
replace the description previously written to the old logs.
Issue: #23200
Diffstat (limited to 'Modules/FindMPI.cmake')
-rw-r--r-- | Modules/FindMPI.cmake | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake index e15be91..1fbb4f9 100644 --- a/Modules/FindMPI.cmake +++ b/Modules/FindMPI.cmake @@ -1259,9 +1259,16 @@ function(_MPI_try_staged_settings LANG MPI_TEST_FILE_NAME MODE RUN_BINARY SUPPRE file(READ "${SRC_DIR}/${MPI_TEST_FILE_NAME}.c" MPI_TEST_SOURCE_CONTENT) set(MPI_TEST_SOURCE_FILE "${MPI_TEST_FILE_NAME}.c") endif() + if(SUPPRESS_ERRORS) + set(maybe_no_log NO_LOG) + else() + set(maybe_no_log "") + endif() if(RUN_BINARY) try_run(MPI_RUN_RESULT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE} MPI_RESULT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE} SOURCE_FROM_VAR "${MPI_TEST_SOURCE_FILE}" MPI_TEST_SOURCE_CONTENT + ${maybe_no_log} + LOG_DESCRIPTION "The MPI test ${MPI_TEST_FILE_NAME} for ${LANG} in mode ${MODE}" COMPILE_DEFINITIONS ${MPI_TEST_COMPILE_DEFINITIONS} LINK_LIBRARIES MPI::MPI_${LANG} RUN_OUTPUT_VARIABLE MPI_RUN_OUTPUT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE} @@ -1270,20 +1277,13 @@ function(_MPI_try_staged_settings LANG MPI_TEST_FILE_NAME MODE RUN_BINARY SUPPRE else() try_compile(MPI_RESULT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE} SOURCE_FROM_VAR "${MPI_TEST_SOURCE_FILE}" MPI_TEST_SOURCE_CONTENT + ${maybe_no_log} + LOG_DESCRIPTION "The MPI test ${MPI_TEST_FILE_NAME} for ${LANG} in mode ${MODE}" COMPILE_DEFINITIONS ${MPI_TEST_COMPILE_DEFINITIONS} LINK_LIBRARIES MPI::MPI_${LANG} COPY_FILE "${BIN_FILE}" OUTPUT_VARIABLE _MPI_TRY_${MPI_TEST_FILE_NAME}_${MODE}_OUTPUT) endif() - if(NOT SUPPRESS_ERRORS) - if(NOT MPI_RESULT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE}) - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "The MPI test ${MPI_TEST_FILE_NAME} for ${LANG} in mode ${MODE} failed to compile with the following output:\n${_MPI_TRY_${MPI_TEST_FILE_NAME}_${MODE}_OUTPUT}\n\n") - elseif(DEFINED MPI_RUN_RESULT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE} AND MPI_RUN_RESULT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE}) - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "The MPI test ${MPI_TEST_FILE_NAME} for ${LANG} in mode ${MODE} failed to run with the following output:\n${MPI_RUN_OUTPUT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE}}\n\n") - endif() - endif() endfunction() macro(_MPI_check_lang_works LANG SUPPRESS_ERRORS) |