summaryrefslogtreecommitdiffstats
path: root/Modules/FindOpenMP.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-11-14 16:28:24 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-11-14 16:28:24 (GMT)
commit3993300ad3e674f9e05241872487c10c7fe2fe43 (patch)
tree62a846212c871ccb9b3493534561b843b9aa9bd6 /Modules/FindOpenMP.cmake
parentbd082a29a99e28be5d4687c391942f6143d9d6b9 (diff)
parentebf70b037ddc45941c3ad2152622fd7326517c1e (diff)
downloadCMake-3993300ad3e674f9e05241872487c10c7fe2fe43.zip
CMake-3993300ad3e674f9e05241872487c10c7fe2fe43.tar.gz
CMake-3993300ad3e674f9e05241872487c10c7fe2fe43.tar.bz2
Merge topic 'openmp-cray'
ebf70b0 FindOpenMP: fix detecting compilers that do not need any special flag (#14567)
Diffstat (limited to 'Modules/FindOpenMP.cmake')
-rw-r--r--Modules/FindOpenMP.cmake9
1 files changed, 5 insertions, 4 deletions
diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake
index ba03f25..fead4a6 100644
--- a/Modules/FindOpenMP.cmake
+++ b/Modules/FindOpenMP.cmake
@@ -42,6 +42,8 @@ set(_OPENMP_REQUIRED_VARS)
function(_OPENMP_FLAG_CANDIDATES LANG)
set(OpenMP_FLAG_CANDIDATES
+ #Empty, if compiler automatically accepts openmp
+ " "
#GNU
"-fopenmp"
#Microsoft Visual Studio
@@ -50,8 +52,6 @@ function(_OPENMP_FLAG_CANDIDATES LANG)
"-Qopenmp"
#PathScale, Intel
"-openmp"
- #Empty, if compiler automatically accepts openmp
- " "
#Sun
"-xopenmp"
#HP
@@ -75,6 +75,7 @@ function(_OPENMP_FLAG_CANDIDATES LANG)
set(OMP_FLAG_PGI "-mp")
set(OMP_FLAG_SunPro "-xopenmp")
set(OMP_FLAG_XL "-qsmp")
+ set(OMP_FLAG_Cray " ")
# Move the flag that matches the compiler to the head of the list,
# this is faster and doesn't clutter the output that much. If that
@@ -111,7 +112,7 @@ if(CMAKE_C_COMPILER_LOADED)
include(${CMAKE_CURRENT_LIST_DIR}/CheckCSourceCompiles.cmake)
endif()
- foreach(FLAG ${OpenMP_C_FLAG_CANDIDATES})
+ foreach(FLAG IN LISTS OpenMP_C_FLAG_CANDIDATES)
set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
set(CMAKE_REQUIRED_FLAGS "${FLAG}")
unset(OpenMP_FLAG_DETECTED CACHE)
@@ -145,7 +146,7 @@ if(CMAKE_CXX_COMPILER_LOADED)
set(OpenMP_CXX_TEST_SOURCE ${OpenMP_C_TEST_SOURCE})
endif()
- foreach(FLAG ${OpenMP_CXX_FLAG_CANDIDATES})
+ foreach(FLAG IN LISTS OpenMP_CXX_FLAG_CANDIDATES)
set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
set(CMAKE_REQUIRED_FLAGS "${FLAG}")
unset(OpenMP_FLAG_DETECTED CACHE)