diff options
author | Brad King <brad.king@kitware.com> | 2018-11-07 12:46:33 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-11-07 12:46:40 (GMT) |
commit | a67d1e824c162a7f84a1d2520199c7e5d10080fb (patch) | |
tree | 0ed8cbae3eaacde604f2250a18de5828258d6df2 /Modules | |
parent | 7e6b78759904dcf31d780a6e2f14f3821f4f23df (diff) | |
parent | 272c4c3dee28a7b1c0a690cac3cb310165324794 (diff) | |
download | CMake-a67d1e824c162a7f84a1d2520199c7e5d10080fb.zip CMake-a67d1e824c162a7f84a1d2520199c7e5d10080fb.tar.gz CMake-a67d1e824c162a7f84a1d2520199c7e5d10080fb.tar.bz2 |
Merge topic 'FindOpenMP-log-errors'
272c4c3dee FindOpenMP: Log error output
db0445f0c8 FindOpenMP: Fix warnings with -Wstrict-prototypes
Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Christian Pfeiffer <cpfeiffer@live.de>
Merge-request: !2574
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindOpenMP.cmake | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake index af45d8e..7e37212 100644 --- a/Modules/FindOpenMP.cmake +++ b/Modules/FindOpenMP.cmake @@ -125,7 +125,7 @@ endfunction() set(OpenMP_C_CXX_TEST_SOURCE " #include <omp.h> -int main() { +int main(void) { #ifdef _OPENMP omp_get_max_threads(); return 0; @@ -271,6 +271,9 @@ function(_OPENMP_GET_FLAGS LANG FLAG_MODE OPENMP_FLAG_VAR OPENMP_LIB_NAMES_VAR) break() endif() endif() + else() + file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + "Detecting ${LANG} OpenMP failed with the following output:\n${OpenMP_TRY_COMPILE_OUTPUT}\n\n") endif() set("${OPENMP_LIB_NAMES_VAR}" "NOTFOUND" PARENT_SCOPE) set("${OPENMP_FLAG_VAR}" "NOTFOUND" PARENT_SCOPE) @@ -292,7 +295,7 @@ const char ompver_str[] = { 'I', 'N', 'F', 'O', ':', 'O', 'p', 'e', 'n', 'M', ('0' + ((_OPENMP/10)%10)), ('0' + ((_OPENMP/1)%10)), ']', '\\0' }; -int main() +int main(void) { puts(ompver_str); return 0; @@ -325,7 +328,8 @@ function(_OPENMP_GET_SPEC_DATE LANG SPEC_DATE) string(REGEX REPLACE "[-/=+]" "" OPENMP_PLAIN_FLAG "${OPENMP_FLAG}") try_compile(OpenMP_SPECTEST_${LANG}_${OPENMP_PLAIN_FLAG} "${CMAKE_BINARY_DIR}" "${_OPENMP_TEST_SRC}" CMAKE_FLAGS "-DCOMPILE_DEFINITIONS:STRING=${OpenMP_${LANG}_FLAGS}" - COPY_FILE ${BIN_FILE}) + COPY_FILE ${BIN_FILE} + OUTPUT_VARIABLE OpenMP_TRY_COMPILE_OUTPUT) if(${OpenMP_SPECTEST_${LANG}_${OPENMP_PLAIN_FLAG}}) file(STRINGS ${BIN_FILE} specstr LIMIT_COUNT 1 REGEX "INFO:OpenMP-date") @@ -333,6 +337,9 @@ function(_OPENMP_GET_SPEC_DATE LANG SPEC_DATE) if("${specstr}" MATCHES "${regex_spec_date}") set(${SPEC_DATE} "${CMAKE_MATCH_1}" PARENT_SCOPE) endif() + else() + file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + "Detecting ${LANG} OpenMP version failed with the following output:\n${OpenMP_TRY_COMPILE_OUTPUT}\n\n") endif() endfunction() |