-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdss_setup_common.py
More file actions
33 lines (29 loc) · 937 Bytes
/
dss_setup_common.py
File metadata and controls
33 lines (29 loc) · 937 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import sys, os, platform
# Not complete but should suffice for the moment
if 'linux' in sys.platform.lower():
uname = os.uname()
if uname.machine == 'aarch64':
arch = 'arm64'
elif uname.machine == 'x86_64':
arch = 'x64'
elif 'arm' in uname.machine:
arch = 'arm32'
else:
arch = 'x86'
else:
arch = 'x64' if (sys.maxsize > (1 << 32)) else 'x86'
if ('-arm64' in os.environ.get('_PYTHON_HOST_PLATFORM', '')) or platform.machine() == 'arm64':
arch = 'arm64'
platform_short = ''.join(filter(lambda ch: ch.isalpha(), sys.platform))
PLATFORM_FOLDER = '{}_{}'.format(platform_short, arch)
if sys.platform == 'win32':
DLL_SUFFIX = '.dll'
DLL_PREFIX = ''
elif sys.platform in ('linux', 'linux2'):
DLL_SUFFIX = '.so'
DLL_PREFIX = 'lib'
elif sys.platform == 'darwin':
DLL_SUFFIX = '.dylib'
DLL_PREFIX = 'lib'
else:
raise RuntimeError("Unsupported platform!")