diff options
author | Justin Lecher <jlec@gentoo.org> | 2012-02-06 13:52:50 +0000 |
---|---|---|
committer | Justin Lecher <jlec@gentoo.org> | 2012-02-06 13:52:50 +0000 |
commit | 69c057f4b5d446a65f1ffe80fd5dd68ef4236266 (patch) | |
tree | bddffa473e64d37c4051f4a08003e361425c8566 /dev-util/cmake/files | |
parent | Fixed compile fail against libpcre. Bug 402357 (diff) | |
download | gentoo-2-69c057f4b5d446a65f1ffe80fd5dd68ef4236266.tar.gz gentoo-2-69c057f4b5d446a65f1ffe80fd5dd68ef4236266.tar.bz2 gentoo-2-69c057f4b5d446a65f1ffe80fd5dd68ef4236266.zip |
Adding patch for language selective openmp support testing, http://public.kitware.com/Bug/view.php?id=11910 ; approved by tampakrap
(Portage version: 2.2.0_alpha85/cvs/Linux x86_64)
Diffstat (limited to 'dev-util/cmake/files')
-rw-r--r-- | dev-util/cmake/files/cmake-2.8.7-FindOpenMP.patch | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/dev-util/cmake/files/cmake-2.8.7-FindOpenMP.patch b/dev-util/cmake/files/cmake-2.8.7-FindOpenMP.patch new file mode 100644 index 000000000000..70e85d856cd2 --- /dev/null +++ b/dev-util/cmake/files/cmake-2.8.7-FindOpenMP.patch @@ -0,0 +1,83 @@ +http://public.kitware.com/Bug/view.php?id=11910 +--- Modules/FindOpenMP.cmake 2011-03-01 17:34:59.000000000 +0900 ++++ Modules/FindOpenMP.cmake 2011-03-01 17:35:26.000000000 +0900 +@@ -72,41 +72,53 @@ + endif(DEFINED OpenMP_C_FLAGS AND DEFINED OpenMP_CXX_FLAGS) + + # check c compiler +-foreach(FLAG ${OpenMP_C_FLAG_CANDIDATES}) +- set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") +- set(CMAKE_REQUIRED_FLAGS "${FLAG}") +- unset(OpenMP_FLAG_DETECTED CACHE) +- message(STATUS "Try OpenMP C flag = [${FLAG}]") +- check_c_source_compiles("${OpenMP_CXX_TEST_SOURCE}" OpenMP_FLAG_DETECTED) +- set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}") +- if(OpenMP_FLAG_DETECTED) +- set(OpenMP_C_FLAGS_INTERNAL "${FLAG}") +- break() +- endif(OpenMP_FLAG_DETECTED) +-endforeach(FLAG ${OpenMP_C_FLAG_CANDIDATES}) ++IF (CMAKE_C_COMPILER) ++ foreach(FLAG ${OpenMP_C_FLAG_CANDIDATES}) ++ set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") ++ set(CMAKE_REQUIRED_FLAGS "${FLAG}") ++ unset(OpenMP_FLAG_DETECTED CACHE) ++ message(STATUS "Try OpenMP C flag = [${FLAG}]") ++ check_c_source_compiles("${OpenMP_C_TEST_SOURCE}" OpenMP_FLAG_DETECTED) ++ set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}") ++ if(OpenMP_FLAG_DETECTED) ++ set(OpenMP_C_FLAGS_INTERNAL "${FLAG}") ++ break() ++ endif(OpenMP_FLAG_DETECTED) ++ endforeach(FLAG ${OpenMP_C_FLAG_CANDIDATES}) ++ENDIF (CMAKE_C_COMPILER) + + # check cxx compiler +-foreach(FLAG ${OpenMP_CXX_FLAG_CANDIDATES}) +- set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") +- set(CMAKE_REQUIRED_FLAGS "${FLAG}") +- unset(OpenMP_FLAG_DETECTED CACHE) +- message(STATUS "Try OpenMP CXX flag = [${FLAG}]") +- check_cxx_source_compiles("${OpenMP_C_TEST_SOURCE}" OpenMP_FLAG_DETECTED) +- set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}") +- if(OpenMP_FLAG_DETECTED) +- set(OpenMP_CXX_FLAGS_INTERNAL "${FLAG}") +- break() +- endif(OpenMP_FLAG_DETECTED) +-endforeach(FLAG ${OpenMP_CXX_FLAG_CANDIDATES}) ++IF (CMAKE_CXX_COMPILER) ++ foreach(FLAG ${OpenMP_CXX_FLAG_CANDIDATES}) ++ set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") ++ set(CMAKE_REQUIRED_FLAGS "${FLAG}") ++ unset(OpenMP_FLAG_DETECTED CACHE) ++ message(STATUS "Try OpenMP CXX flag = [${FLAG}]") ++ check_cxx_source_compiles("${OpenMP_CXX_TEST_SOURCE}" OpenMP_FLAG_DETECTED) ++ set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}") ++ if(OpenMP_FLAG_DETECTED) ++ set(OpenMP_CXX_FLAGS_INTERNAL "${FLAG}") ++ break() ++ endif(OpenMP_FLAG_DETECTED) ++ endforeach(FLAG ${OpenMP_CXX_FLAG_CANDIDATES}) ++ENDIF (CMAKE_CXX_COMPILER) + + set(OpenMP_C_FLAGS "${OpenMP_C_FLAGS_INTERNAL}" + CACHE STRING "C compiler flags for OpenMP parallization") + + set(OpenMP_CXX_FLAGS "${OpenMP_CXX_FLAGS_INTERNAL}" + CACHE STRING "C++ compiler flags for OpenMP parallization") ++ + # handle the standard arguments for find_package +-find_package_handle_standard_args(OpenMP DEFAULT_MSG +- OpenMP_C_FLAGS OpenMP_CXX_FLAGS ) ++IF (CMAKE_C_COMPILER) ++ find_package_handle_standard_args(OpenMP DEFAULT_MSG ++ OpenMP_C_FLAGS ) ++ENDIF (CMAKE_C_COMPILER) ++ ++IF (CMAKE_CXX_COMPILER) ++ find_package_handle_standard_args(OpenMP DEFAULT_MSG ++ OpenMP_CXX_FLAGS ) ++ENDIF (CMAKE_CXX_COMPILER) + + mark_as_advanced( + OpenMP_C_FLAGS |