Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
5481a807
"examples/vscode:/vscode.git/clone" did not exist on "362f72cbe92d63e9f106f397ba5ddb81638714c7"
Commit
5481a807
authored
Jan 02, 2014
by
Davis King
Browse files
Added cmake options to easily turn SSE/AVX instructions on/off
parent
103b4649
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
dlib/cmake
dlib/cmake
+23
-0
No files found.
dlib/cmake
View file @
5481a807
...
@@ -12,6 +12,29 @@ if (NOT TARGET dlib)
...
@@ -12,6 +12,29 @@ if (NOT TARGET dlib)
add_definitions("-Wreturn-type")
add_definitions("-Wreturn-type")
endif()
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")
if(USE_AVX_INSTRUCTIONS)
add_definitions(-mavx)
elseif (USE_SSE4_INSTRUCTIONS)
add_definitions(-msse4)
elseif(USE_SSE2_INSTRUCTIONS)
add_definitions(-msse2)
endif()
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") # Visual Studio
if(USE_AVX_INSTRUCTIONS)
add_definitions(/arch:AVX)
elseif (USE_SSE4_INSTRUCTIONS)
add_definitions(/arch:SSE2) # There isn't an /arch:SSE4 flag in visual studio.
elseif(USE_SSE2_INSTRUCTIONS)
add_definitions(/arch:SSE2)
endif()
endif()
# Add folder containing dlib to the include search path.
# Add folder containing dlib to the include search path.
INCLUDE_DIRECTORIES(${dlib_path}/..)
INCLUDE_DIRECTORIES(${dlib_path}/..)
...
...
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