mirror of https://github.com/davisking/dlib.git
use Python's architecture to give cmake a clue to generate the right config
This commit is contained in:
parent
8e2ec4cc6a
commit
e469105178
9
setup.py
9
setup.py
|
@ -326,6 +326,13 @@ class build(_build):
|
|||
platform_arch = platform.architecture()[0]
|
||||
log.info("Detected Python architecture: %s" % platform_arch)
|
||||
|
||||
# make sure build artifacts are generated for the version of Python currently running
|
||||
cmake_extra_arch = []
|
||||
if platform_arch == '64bit':
|
||||
cmake_extra_arch = ['-DCMAKE_SIZEOF_VOID_P=8']
|
||||
elif platform_arch == '32bit':
|
||||
cmake_extra_arch = ['-DCMAKE_SIZEOF_VOID_P=4']
|
||||
|
||||
build_dir = os.path.join(script_dir, "./tools/python/build")
|
||||
if os.path.exists(build_dir):
|
||||
log.info('Removing build directory %s' % build_dir)
|
||||
|
@ -342,7 +349,7 @@ class build(_build):
|
|||
cmake_cmd = [
|
||||
cmake_path,
|
||||
"..",
|
||||
] + cmake_extra
|
||||
] + cmake_extra + cmake_extra_arch
|
||||
if run_process(cmake_cmd):
|
||||
raise DistutilsSetupError("cmake configuration failed!")
|
||||
|
||||
|
|
Loading…
Reference in New Issue