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
6e2ed37f
Commit
6e2ed37f
authored
Aug 26, 2015
by
Ehsan Azarnasab
Browse files
find 64bit Python libraries on 64bit Windows when cmake is 32bit
parent
1c6ba8a1
Changes
1
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
...
@@ -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.command.build
import
build
as
_build
from
distutils.errors
import
DistutilsSetupError
from
distutils.errors
import
DistutilsSetupError
from
distutils.spawn
import
find_executable
from
distutils.spawn
import
find_executable
from
distutils.sysconfig
import
get_python_inc
,
get_python_version
from
distutils
import
log
from
distutils
import
log
import
os
import
os
import
sys
import
sys
...
@@ -328,10 +329,27 @@ class build(_build):
...
@@ -328,10 +329,27 @@ class build(_build):
# make sure build artifacts are generated for the version of Python currently running
# make sure build artifacts are generated for the version of Python currently running
cmake_extra_arch
=
[]
cmake_extra_arch
=
[]
if
sys
.
version_info
>=
(
3
,
0
):
cmake_extra_arch
+=
[
'-DPYTHON3=yes'
]
if
platform_arch
==
'64bit'
:
if
platform_arch
==
'64bit'
:
cmake_extra_arch
=
[
'-DCMAKE_SIZEOF_VOID_P=8'
]
cmake_extra_arch
+
=
[
'-DCMAKE_SIZEOF_VOID_P=8'
]
elif
platform_arch
==
'32bit'
:
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"
)
build_dir
=
os
.
path
.
join
(
script_dir
,
"./tools/python/build"
)
if
os
.
path
.
exists
(
build_dir
):
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