Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
6dcaaab6
Commit
6dcaaab6
authored
Jan 03, 2014
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
When using visual studio, made cmake only show the supported SSE options.
parent
6a037bc1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
cmake
dlib/cmake
+8
-2
No files found.
dlib/cmake
View file @
6dcaaab6
...
...
@@ -13,7 +13,7 @@ if (NOT TARGET dlib)
endif()
# Setup some options to allow a user to enable SSE and AVX instruction use.
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
if (
CMAKE_COMPILER_IS_GNUCXX OR
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
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)
...
...
@@ -24,11 +24,17 @@ if (NOT TARGET dlib)
elseif(USE_SSE2_INSTRUCTIONS)
add_definitions(-msse2)
endif()
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") # else if using Visual Studio
elseif (
MSVC OR
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") # else if using Visual Studio
# Use SSE2 by default when using Visual Studio.
option(USE_SSE2_INSTRUCTIONS "Compile your program with SSE2 instructions" ON)
# Visual Studio 2005 didn't support SSE4
if (NOT MSVC80)
option(USE_SSE4_INSTRUCTIONS "Compile your program with SSE4 instructions" OFF)
endif()
# Visual Studio 2005 and 2008 didn't support AVX
if (NOT MSVC80 AND NOT MSVC90)
option(USE_AVX_INSTRUCTIONS "Compile your program with AVX instructions" OFF)
endif()
include(CheckTypeSize)
check_type_size( "void*" SIZE_OF_VOID_PTR)
if(USE_AVX_INSTRUCTIONS)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment