diff options
author | Hauke Heibel <hauke.heibel@gmail.com> | 2010-07-01 07:28:16 +0200 |
---|---|---|
committer | Hauke Heibel <hauke.heibel@gmail.com> | 2010-07-01 07:28:16 +0200 |
commit | ce1e5e52dddaf95e80bfb8313a7f2a4947036ebc (patch) | |
tree | 7f37a972de811a95b62956893904a86ef7ffa871 /CMakeLists.txt | |
parent | b2122274181a3fd5cb9196700c858e7493c17c51 (diff) |
Enable OpenMP testing for MSVC.
Added CMake comments.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 45b109d9a..2d302386c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -174,7 +174,19 @@ if(MSVC) # exceptions to cover indexing errors. # C4505 - unreferenced local function has been removed (impossible to deactive selectively) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /wd4127 /wd4505 /wd4714") + + # replace all /Wx by /W4 string(REGEX REPLACE "/W[0-9]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + + check_cxx_compiler_flag("/openmp" COMPILER_SUPPORT_OPENMP) + if(COMPILER_SUPPORT_OPENMP) + option(EIGEN_TEST_OPENMP "Enable/Disable OpenMP in tests/examples" OFF) + if(EIGEN_TEST_OPENMP) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /openmp") + message("Enabling OpenMP in tests/examples") + endif() + endif() + option(EIGEN_TEST_SSE2 "Enable/Disable SSE2 in tests/examples" OFF) if(EIGEN_TEST_SSE2) if(NOT CMAKE_CL_64) |