From ed6530264f56d9f35cc3ae16ab61494b68e647de Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Sat, 25 Mar 2017 12:03:40 -0700 Subject: [PATCH] enable USE_MSVC_SSE2 for MSVC by default, AVX for MSVX disabled by default. --- CMakeLists.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 05a7897e7..cca0c797d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -85,10 +85,23 @@ IF(MSVC) ADD_DEFINITIONS(-D_WIN64) ELSE() OPTION(USE_MSVC_SSE "Use MSVC /arch:sse option" ON) + option(USE_MSVC_SSE2 "Compile your program with SSE2 instructions" ON) + IF (USE_MSVC_SSE) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:SSE") ENDIF() + IF (USE_MSVC_SSE2) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:SSE2") + ENDIF() + ENDIF() + + option(USE_MSVC_AVX "Compile your program with AVX instructions" OFF) + + IF(USE_MSVC_AVX) + add_definitions(/arch:AVX) + ENDIF() + OPTION(USE_MSVC_FAST_FLOATINGPOINT "Use MSVC /fp:fast option" ON) IF (USE_MSVC_FAST_FLOATINGPOINT) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:fast")