diff options
author | Brad King <brad.king@kitware.com> | 2017-10-06 11:18:13 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-10-06 11:18:13 (GMT) |
commit | 7a31da43b1b598a255bf5261f7dff66e5aa71dd0 (patch) | |
tree | ad7e8cc71a324b279975e67727d2219337d95804 | |
parent | 09a3a1cb9f0e832fd9b882027df80fd8a198b427 (diff) | |
parent | e25d88ecb9925af45d990d47132bd45f86e20485 (diff) | |
download | CMake-7a31da43b1b598a255bf5261f7dff66e5aa71dd0.zip CMake-7a31da43b1b598a255bf5261f7dff66e5aa71dd0.tar.gz CMake-7a31da43b1b598a255bf5261f7dff66e5aa71dd0.tar.bz2 |
Merge branch 'findopenmp-fix-verbose' into release-3.10
Merge-request: !1348
-rw-r--r-- | Modules/FindOpenMP.cmake | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake index 272f4dc..1d6a039 100644 --- a/Modules/FindOpenMP.cmake +++ b/Modules/FindOpenMP.cmake @@ -166,14 +166,23 @@ function(_OPENMP_GET_FLAGS LANG FLAG_MODE OPENMP_FLAG_VAR OPENMP_LIB_NAMES_VAR) _OPENMP_FLAG_CANDIDATES("${LANG}") _OPENMP_WRITE_SOURCE_FILE("${LANG}" "TEST_SOURCE" OpenMPTryFlag _OPENMP_TEST_SRC) + unset(OpenMP_VERBOSE_COMPILE_OPTIONS) + separate_arguments(OpenMP_VERBOSE_OPTIONS NATIVE_COMMAND "${CMAKE_${LANG}_VERBOSE_FLAG}") + foreach(_VERBOSE_OPTION IN LISTS OpenMP_VERBOSE_OPTIONS) + if(NOT _VERBOSE_OPTION MATCHES "^-Wl,") + list(APPEND OpenMP_VERBOSE_COMPILE_OPTIONS ${_VERBOSE_OPTION}) + endif() + endforeach() + foreach(OPENMP_FLAG IN LISTS OpenMP_${LANG}_FLAG_CANDIDATES) set(OPENMP_FLAGS_TEST "${OPENMP_FLAG}") - if(CMAKE_${LANG}_VERBOSE_FLAG) - string(APPEND OPENMP_FLAGS_TEST " ${CMAKE_${LANG}_VERBOSE_FLAG}") + if(OpenMP_VERBOSE_COMPILE_OPTIONS) + string(APPEND OPENMP_FLAGS_TEST " ${OpenMP_VERBOSE_COMPILE_OPTIONS}") endif() string(REGEX REPLACE "[-/=+]" "" OPENMP_PLAIN_FLAG "${OPENMP_FLAG}") try_compile( OpenMP_COMPILE_RESULT_${FLAG_MODE}_${OPENMP_PLAIN_FLAG} ${CMAKE_BINARY_DIR} ${_OPENMP_TEST_SRC} CMAKE_FLAGS "-DCOMPILE_DEFINITIONS:STRING=${OPENMP_FLAGS_TEST}" + LINK_LIBRARIES ${CMAKE_${LANG}_VERBOSE_FLAG} OUTPUT_VARIABLE OpenMP_TRY_COMPILE_OUTPUT ) @@ -230,6 +239,8 @@ function(_OPENMP_GET_FLAGS LANG FLAG_MODE OPENMP_FLAG_VAR OPENMP_LIB_NAMES_VAR) set("${OPENMP_LIB_NAMES_VAR}" "NOTFOUND" PARENT_SCOPE) set("${OPENMP_FLAG_VAR}" "NOTFOUND" PARENT_SCOPE) endforeach() + + unset(OpenMP_VERBOSE_COMPILE_OPTIONS) endfunction() set(OpenMP_C_CXX_CHECK_VERSION_SOURCE |