From d4cd8779eedcd657ecc6f3498737111c9b0c1b09 Mon Sep 17 00:00:00 2001 From: Davis King Date: Thu, 2 Jan 2014 12:10:00 -0500 Subject: [PATCH] Made the default cmake settings enable SSE2 instructions when using Visual Studio. --- dlib/cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlib/cmake b/dlib/cmake index 96f6804de..c50807397 100644 --- a/dlib/cmake +++ b/dlib/cmake @@ -12,11 +12,11 @@ if (NOT TARGET dlib) add_definitions("-Wreturn-type") endif() - option(USE_SSE2_INSTRUCTIONS "Compile your program with SSE2 instructions" OFF) option(USE_SSE4_INSTRUCTIONS "Compile your program with SSE4 instructions" OFF) option(USE_AVX_INSTRUCTIONS "Compile your program with AVX instructions" OFF) if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + option(USE_SSE2_INSTRUCTIONS "Compile your program with SSE2 instructions" OFF) if(USE_AVX_INSTRUCTIONS) add_definitions(-mavx) elseif (USE_SSE4_INSTRUCTIONS) @@ -25,6 +25,8 @@ if (NOT TARGET dlib) add_definitions(-msse2) endif() elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") # Visual Studio + # Use SSE2 by default when using Visual Studio + option(USE_SSE2_INSTRUCTIONS "Compile your program with SSE2 instructions" ON) if(USE_AVX_INSTRUCTIONS) add_definitions(/arch:AVX) elseif (USE_SSE4_INSTRUCTIONS)