Skip to content

Commit f26852a

Browse files
committed
Fixed Windows wheel builds
1 parent 9ac0d2c commit f26852a

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

setup.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,23 +89,27 @@ def build_extension(self, ext):
8989
if not extdir.endswith(os.path.sep):
9090
extdir += os.path.sep
9191

92-
cmake_args = ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + extdir,
93-
'-DPYTHON_EXECUTABLE=' + sys.executable]
92+
# initialize cmake_args and build_args
93+
cmake_args = []
94+
build_args = []
95+
96+
# Specify output directory and python executable
97+
cmake_args += ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + extdir, '-DPYTHON_EXECUTABLE=' + sys.executable]
9498

9599
# Pass a commit hash
96100
if buildCommitHash != None :
97101
cmake_args += ['-DDEPTHAI_PYTHON_COMMIT_HASH=' + buildCommitHash]
98102

99103
# Pass a docstring option
100-
if os.environ['DEPTHAI_PYTHON_DOCSTRINGS_INPUT'] != None:
104+
if 'DEPTHAI_PYTHON_DOCSTRINGS_INPUT' in os.environ:
101105
cmake_args += ['-DDEPTHAI_PYTHON_DOCSTRINGS_INPUT='+os.environ['DEPTHAI_PYTHON_DOCSTRINGS_INPUT']]
102106
cmake_args += ['-DDEPTHAI_PYTHON_BUILD_DOCSTRINGS=OFF']
103107

104108
# Set build type (debug vs release for library as well as dependencies)
105109
cfg = 'Debug' if self.debug else 'Release'
106110
cmake_args += ['-DCMAKE_BUILD_TYPE=' + cfg]
107111
cmake_args += ['-DHUNTER_CONFIGURATION_TYPES=' + cfg]
108-
build_args = ['--config', cfg]
112+
build_args += ['--config', cfg]
109113

110114
# Memcheck (guard if it fails)
111115
totalMemory = 4000
@@ -132,7 +136,7 @@ def build_extension(self, ext):
132136
cmake_args += ['-A', 'Win32']
133137

134138
# Add flag to build with maximum available threads
135-
build_args = ['--', '/m']
139+
build_args += ['--', '/m']
136140
# Unix
137141
else:
138142
# if macos add some additional env vars
@@ -196,6 +200,7 @@ def build_extension(self, ext):
196200
"Programming Language :: Python :: 3.6",
197201
"Programming Language :: Python :: 3.7",
198202
"Programming Language :: Python :: 3.8",
203+
"Programming Language :: Python :: 3.9",
199204
"Programming Language :: C++",
200205
"Programming Language :: Python :: Implementation :: CPython",
201206
"Topic :: Scientific/Engineering",

0 commit comments

Comments
 (0)