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
89ee7cdb
Commit
89ee7cdb
authored
Feb 12, 2017
by
Davis King
Browse files
Make sure fPIC gets propagated to nvcc in all cases.
parent
9bd418a5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
+6
-0
dlib/CMakeLists.txt
dlib/CMakeLists.txt
+5
-0
dlib/cmake_utils/add_python_module
dlib/cmake_utils/add_python_module
+1
-0
No files found.
dlib/CMakeLists.txt
View file @
89ee7cdb
...
...
@@ -529,6 +529,11 @@ if (NOT TARGET dlib)
# magic in the standard C++ header files (since nvcc uses gcc headers on
# linux).
list
(
APPEND CUDA_NVCC_FLAGS
"-arch=sm_30;-std=c++11;-D__STRICT_ANSI__;-D_MWAITXINTRIN_H_INCLUDED;-D_FORCE_INLINES;
${
FLAGS_FOR_NVCC
}
"
)
if
(
CMAKE_POSITION_INDEPENDENT_CODE
)
# sometimes this setting isn't propagated to NVCC, which then causes the
# compile to fail. So make sure it's propagated.
list
(
APPEND CUDA_NVCC_FLAGS
"-Xcompiler -fPIC"
)
endif
()
include
(
cmake_utils/test_for_cudnn/find_cudnn.txt
)
...
...
dlib/cmake_utils/add_python_module
View file @
89ee7cdb
...
...
@@ -132,6 +132,7 @@ if (CMAKE_COMPILER_IS_GNUCXX)
# -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()
...
...
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