Skip to content

Commit

Permalink
Update setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Nagico2 authored Jul 26, 2024
1 parent af2cd39 commit 4258c5c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,19 @@ def build_extension(self, ext):
ext.extra_link_args = libs
_build_ext.build_extension(self, ext)


if os.name == 'nt':
# Must pre-install sentencepice into build directory.
def get_win_arch():
arch = 'win32'
if sys.maxsize > 2**32:
arch = 'amd64'
if 'arm' in platform.machine().lower():
arch = 'arm64'
if os.getenv('PYTHON_ARCH', '') == 'ARM64': # special check for arm64 under ciwheelbuild
arch = 'arm64'
return arch

if os.name == 'nt':
# Must pre-install sentencepice into build directory.
arch = get_win_arch()
if os.path.exists('..\\build\\root_{}\\lib'.format(arch)):
cflags = ['/std:c++17', '/I..\\build\\root_{}\\include'.format(arch)]
libs = [
Expand Down

0 comments on commit 4258c5c

Please sign in to comment.