Skip to content

Commit 2eced23

Browse files
committed
setup.py: fix out of tree builds on Windows [wip]
1 parent c95134c commit 2eced23

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

setup.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,20 @@ def run(self):
175175
else:
176176
platform = "x64" if IS_64_BIT else "x86"
177177
config = "Release"
178+
properties = {
179+
"Configuration": config,
180+
"Platform": platform,
181+
"IntermediateOutputPath": str(build_temp / platform / "obj") + "\\", # Must end with trailing slash.
182+
"OutDir": str(build_temp / platform / config) + "\\",
183+
#IntermediateOutputPath
184+
#OutputPath
185+
}
186+
187+
property_values = ';'.join(f'{k}={v}' for k, v in properties.items())
188+
msbuild_cmd = f'msbuild -p:{property_values} {VS_PROJ}'
178189

179190
try:
180-
self.spawn(['cmd.exe', '/c', f'{VSENV_SCRIPT} && '
181-
f'msbuild -p:Configuration={config} -p:Platform={platform} {VS_PROJ}'])
191+
self.spawn(['cmd.exe', '/c', f'{VSENV_SCRIPT} && {msbuild_cmd}'])
182192
except Exception as err:
183193
# See comment above for notes about this exception handler.
184194
raise LibusbBuildError(str(err)) from err

0 commit comments

Comments
 (0)