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
5f5684a8
Commit
5f5684a8
authored
Jan 16, 2017
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made python library and header detection more robust
parent
7cf1a928
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
setup.py
setup.py
+6
-8
No files found.
setup.py
View file @
5f5684a8
...
...
@@ -505,10 +505,12 @@ class build(_build):
# make sure build artifacts are generated for the version of Python currently running
cmake_extra_arch
=
[]
from
distutils.sysconfig
import
get_python_inc
import
distutils.sysconfig
as
sysconfig
cmake_extra_arch
+=
[
'-DPYTHON_INCLUDE_DIR='
+
get_python_inc
()]
cmake_extra_arch
+=
[
'-DPYTHON_LIBRARY='
+
sysconfig
.
get_config_var
(
'LIBDIR'
)]
inc_dir
=
get_python_inc
()
lib_dir
=
get_config_var
(
'LIBDIR'
)
if
(
inc_dir
!=
None
):
cmake_extra_arch
+=
[
'-DPYTHON_INCLUDE_DIR='
+
inc_dir
]
if
(
lib_dir
!=
None
):
cmake_extra_arch
+=
[
'-DCMAKE_LIBRARY_PATH='
+
lib_dir
]
if
sys
.
version_info
>=
(
3
,
0
):
cmake_extra_arch
+=
[
'-DPYTHON3=yes'
]
...
...
@@ -516,8 +518,6 @@ class build(_build):
log
.
info
(
"Detected platform:
%
s"
%
sys
.
platform
)
if
sys
.
platform
==
"darwin"
:
# build on OS X
inc_dir
=
get_python_inc
()
cmake_extra_arch
+=
[
'-DPYTHON_INCLUDE_DIR={inc}'
.
format
(
inc
=
inc_dir
)]
# by default, cmake will choose the system python lib in /usr/lib
# this checks the sysconfig and will correctly pick up a brewed python lib
...
...
@@ -530,8 +530,6 @@ class build(_build):
if
platform_arch
==
'64bit'
and
not
generator_set
:
cmake_extra_arch
+=
get_msvc_win64_generator
()
inc_dir
=
get_python_inc
()
cmake_extra_arch
+=
[
'-DPYTHON_INCLUDE_DIR={inc}'
.
format
(
inc
=
inc_dir
)]
# this imitates cmake in path resolution
py_ver
=
get_python_version
()
for
ext
in
[
py_ver
.
replace
(
"."
,
""
)
+
'.lib'
,
py_ver
+
'mu.lib'
,
py_ver
+
'm.lib'
,
py_ver
+
'u.lib'
]:
...
...
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