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
24ac9bc4
Commit
24ac9bc4
authored
Apr 06, 2018
by
Davis King
Browse files
A bit of cmake cleanup
parent
4a97b216
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
12 deletions
+14
-12
dlib/CMakeLists.txt
dlib/CMakeLists.txt
+14
-0
tools/python/CMakeLists.txt
tools/python/CMakeLists.txt
+0
-12
No files found.
dlib/CMakeLists.txt
View file @
24ac9bc4
...
...
@@ -35,6 +35,20 @@ endif()
if
(
DLIB_IN_PROJECT_BUILD
)
# Check if we are being built as part of a pybind11 module.
if
(
COMMAND pybind11_add_module
)
set
(
CMAKE_POSITION_INDEPENDENT_CODE True
)
if
(
CMAKE_COMPILER_IS_GNUCXX
)
# Just setting CMAKE_POSITION_INDEPENDENT_CODE should be enough to set
# -fPIC for GCC but sometimes it still doesn't get set, so make sure it
# does.
add_definitions
(
"-fPIC"
)
endif
()
# Make DLIB_ASSERT statements not abort the python interpreter, but just return an error.
list
(
APPEND active_preprocessor_switches
"-DDLIB_NO_ABORT_ON_2ND_FATAL_ERROR"
)
endif
()
# DLIB_IN_PROJECT_BUILD==true means you are using dlib by invoking
# add_subdirectory(dlib) in the parent project. In this case, we always want
# to build dlib as a static library so the parent project doesn't need to
...
...
tools/python/CMakeLists.txt
View file @
24ac9bc4
...
...
@@ -2,8 +2,6 @@
CMAKE_MINIMUM_REQUIRED
(
VERSION 2.8.12
)
set
(
USE_SSE4_INSTRUCTIONS ON CACHE BOOL
"Use SSE4 instructions"
)
# Make DLIB_ASSERT statements not abort the python interpreter, but just return an error.
add_definitions
(
-DDLIB_NO_ABORT_ON_2ND_FATAL_ERROR
)
# Set this to disable link time optimization. The only reason for
# doing this to make the compile faster which is nice when developing
...
...
@@ -18,16 +16,6 @@ if (POLICY CMP0042)
endif
()
if
(
CMAKE_COMPILER_IS_GNUCXX
)
# Just setting CMAKE_POSITION_INDEPENDENT_CODE should be enough to set
# -fPIC for GCC but sometimes it still doesn't get set, so make sure it
# does.
add_definitions
(
"-fPIC"
)
set
(
CMAKE_POSITION_INDEPENDENT_CODE True
)
else
()
set
(
CMAKE_POSITION_INDEPENDENT_CODE True
)
endif
()
# To avoid dll hell, always link everything statically when compiling in
# visual studio. This way, the resulting library won't depend on a bunch
# of other dll files and can be safely copied to someone elese's computer
...
...
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