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
6e2ed37f
Commit
6e2ed37f
authored
Aug 26, 2015
by
Ehsan Azarnasab
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
find 64bit Python libraries on 64bit Windows when cmake is 32bit
parent
1c6ba8a1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
setup.py
setup.py
+20
-2
No files found.
setup.py
View file @
6e2ed37f
...
...
@@ -33,6 +33,7 @@ from distutils.command.build_ext import build_ext as _build_ext
from
distutils.command.build
import
build
as
_build
from
distutils.errors
import
DistutilsSetupError
from
distutils.spawn
import
find_executable
from
distutils.sysconfig
import
get_python_inc
,
get_python_version
from
distutils
import
log
import
os
import
sys
...
...
@@ -328,10 +329,27 @@ class build(_build):
# make sure build artifacts are generated for the version of Python currently running
cmake_extra_arch
=
[]
if
sys
.
version_info
>=
(
3
,
0
):
cmake_extra_arch
+=
[
'-DPYTHON3=yes'
]
if
platform_arch
==
'64bit'
:
cmake_extra_arch
=
[
'-DCMAKE_SIZEOF_VOID_P=8'
]
cmake_extra_arch
+
=
[
'-DCMAKE_SIZEOF_VOID_P=8'
]
elif
platform_arch
==
'32bit'
:
cmake_extra_arch
=
[
'-DCMAKE_SIZEOF_VOID_P=4'
]
cmake_extra_arch
+=
[
'-DCMAKE_SIZEOF_VOID_P=4'
]
if
platform_arch
==
'64bit'
and
sys
.
platform
==
"win32"
:
# help cmake to find Python library in 64bit Python in Windows
# because cmake is 32bit and cannot find PYTHON_LIBRARY from registry.
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'
]:
py_lib
=
os
.
path
.
abspath
(
os
.
path
.
join
(
inc_dir
,
'../libs/'
,
'python'
+
ext
))
if
os
.
path
.
exists
(
py_lib
):
cmake_extra_arch
+=
[
'-DPYTHON_LIBRARY={lib}'
.
format
(
lib
=
py_lib
)]
break
build_dir
=
os
.
path
.
join
(
script_dir
,
"./tools/python/build"
)
if
os
.
path
.
exists
(
build_dir
):
...
...
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