This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
       via  9ceafdfd4deec57c3a7f8650b2466da1d0aa0d3f (commit)
       via  e3cd7c1e014aa48b72d414104b9c1bd6bc03fd64 (commit)
       via  b4c539e6511110e893416467a77c36ec7ebef81d (commit)
       via  7dd8c7a680f409fdb1d78138e20fa9b80206431a (commit)
      from  29b41babdb78b5e305ed9fc6b84dd69c1795dc69 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9ceafdfd4deec57c3a7f8650b2466da1d0aa0d3f
commit 9ceafdfd4deec57c3a7f8650b2466da1d0aa0d3f
Merge: 29b41ba e3cd7c1
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Wed Mar 7 13:33:18 2018 +0000
Commit:     Kitware Robot <kwro...@kitware.com>
CommitDate: Wed Mar 7 08:33:33 2018 -0500

    Merge topic 'FindOpenMP-AppleClang'
    
    e3cd7c1e01 FindOpenMP: Add support for AppleClang compiler
    b4c539e651 FindOpenMP: Verify in test source that OMP library is linked
    7dd8c7a680 FindOpenMP: Improve inclusion of helper modules
    
    Acked-by: Kitware Robot <kwro...@kitware.com>
    Merge-request: !1812


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e3cd7c1e014aa48b72d414104b9c1bd6bc03fd64
commit e3cd7c1e014aa48b72d414104b9c1bd6bc03fd64
Author:     Henry Fredrick Schreiner <henry.fredrick.schrei...@cern.ch>
AuthorDate: Thu Mar 1 12:35:38 2018 +0100
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Wed Mar 7 08:27:35 2018 -0500

    FindOpenMP: Add support for AppleClang compiler
    
    This is possible using an external `omp` library and by passing
    the flag past the compiler driver via `-Xclang -fopenmp`.
    
    Fixes: #17775

diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake
index 95e5cdc..e252ba5 100644
--- a/Modules/FindOpenMP.cmake
+++ b/Modules/FindOpenMP.cmake
@@ -85,6 +85,7 @@ function(_OPENMP_FLAG_CANDIDATES LANG)
 
     set(OMP_FLAG_GNU "-fopenmp")
     set(OMP_FLAG_Clang "-fopenmp=libomp" "-fopenmp=libiomp5" "-fopenmp")
+    set(OMP_FLAG_AppleClang "-Xclang -fopenmp")
     set(OMP_FLAG_HP "+Oopenmp")
     if(WIN32)
       set(OMP_FLAG_Intel "-Qopenmp")
@@ -256,6 +257,28 @@ function(_OPENMP_GET_FLAGS LANG FLAG_MODE OPENMP_FLAG_VAR 
OPENMP_LIB_NAMES_VAR)
         endif()
       endif()
       break()
+    elseif(CMAKE_${LANG}_COMPILER_ID STREQUAL "AppleClang"
+      AND CMAKE_${LANG}_COMPILER_VERSION VERSION_GREATER_EQUAL "7.0")
+
+      # Check for separate OpenMP library on AppleClang 7+
+      find_library(OpenMP_libomp_LIBRARY
+        NAMES omp gomp iomp5
+        HINTS ${CMAKE_${LANG}_IMPLICIT_LINK_DIRECTORIES}
+      )
+      mark_as_advanced(OpenMP_libomp_LIBRARY)
+
+      if(OpenMP_libomp_LIBRARY)
+        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} ${OpenMP_libomp_LIBRARY}
+          OUTPUT_VARIABLE OpenMP_TRY_COMPILE_OUTPUT
+        )
+        if(OpenMP_COMPILE_RESULT_${FLAG_MODE}_${OPENMP_PLAIN_FLAG})
+          set("${OPENMP_FLAG_VAR}" "${OPENMP_FLAG}" PARENT_SCOPE)
+          set("${OPENMP_LIB_NAMES_VAR}" "libomp" PARENT_SCOPE)
+          break()
+        endif()
+      endif()
     endif()
     set("${OPENMP_LIB_NAMES_VAR}" "NOTFOUND" PARENT_SCOPE)
     set("${OPENMP_FLAG_VAR}" "NOTFOUND" PARENT_SCOPE)

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b4c539e6511110e893416467a77c36ec7ebef81d
commit b4c539e6511110e893416467a77c36ec7ebef81d
Author:     Henry Fredrick Schreiner <henry.fredrick.schrei...@cern.ch>
AuthorDate: Thu Mar 1 12:35:38 2018 +0100
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Wed Mar 7 08:25:45 2018 -0500

    FindOpenMP: Verify in test source that OMP library is linked

diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake
index 3f8f61a..95e5cdc 100644
--- a/Modules/FindOpenMP.cmake
+++ b/Modules/FindOpenMP.cmake
@@ -125,6 +125,7 @@ set(OpenMP_C_CXX_TEST_SOURCE
 #include <omp.h>
 int main() {
 #ifdef _OPENMP
+  int n = omp_get_max_threads();
   return 0;
 #else
   breaks_on_purpose

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7dd8c7a680f409fdb1d78138e20fa9b80206431a
commit 7dd8c7a680f409fdb1d78138e20fa9b80206431a
Author:     Henry Fredrick Schreiner <henry.fredrick.schrei...@cern.ch>
AuthorDate: Thu Mar 1 12:35:38 2018 +0100
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Wed Mar 7 08:24:27 2018 -0500

    FindOpenMP: Improve inclusion of helper modules
    
    Use `CMAKE_CURRENT_LIST_DIR` instead of `CMAKE_ROOT`.
    Do not include modules inside a loop.

diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake
index ced092e..3f8f61a 100644
--- a/Modules/FindOpenMP.cmake
+++ b/Modules/FindOpenMP.cmake
@@ -163,7 +163,7 @@ function(_OPENMP_WRITE_SOURCE_FILE LANG 
SRC_FILE_CONTENT_VAR SRC_FILE_NAME SRC_F
   set(${SRC_FILE_FULLPATH} "${SRC_FILE}" PARENT_SCOPE)
 endfunction()
 
-include(${CMAKE_ROOT}/Modules/CMakeParseImplicitLinkInfo.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/CMakeParseImplicitLinkInfo.cmake)
 
 function(_OPENMP_GET_FLAGS LANG FLAG_MODE OPENMP_FLAG_VAR OPENMP_LIB_NAMES_VAR)
   _OPENMP_FLAG_CANDIDATES("${LANG}")
@@ -423,6 +423,8 @@ endif()
 
 unset(_OpenMP_MIN_VERSION)
 
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+
 foreach(LANG IN LISTS OpenMP_FINDLIST)
   if(CMAKE_${LANG}_COMPILER_LOADED)
     if (NOT OpenMP_${LANG}_SPEC_DATE AND OpenMP_${LANG}_FLAGS)
@@ -432,8 +434,6 @@ foreach(LANG IN LISTS OpenMP_FINDLIST)
       _OPENMP_SET_VERSION_BY_SPEC_DATE("${LANG}")
     endif()
 
-    include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-
     set(OpenMP_${LANG}_FIND_QUIETLY ${OpenMP_FIND_QUIETLY})
     set(OpenMP_${LANG}_FIND_REQUIRED ${OpenMP_FIND_REQUIRED})
     set(OpenMP_${LANG}_FIND_VERSION ${OpenMP_FIND_VERSION})

-----------------------------------------------------------------------

Summary of changes:
 Modules/FindOpenMP.cmake |   30 +++++++++++++++++++++++++++---
 1 file changed, 27 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
https://cmake.org/mailman/listinfo/cmake-commits

Reply via email to