Skip to content

Commit

Permalink
setup.py: fix out of tree builds on Windows [wip]
Browse files Browse the repository at this point in the history
  • Loading branch information
flit committed Dec 17, 2022
1 parent c95134c commit 2eced23
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,20 @@ def run(self):
else:
platform = "x64" if IS_64_BIT else "x86"
config = "Release"
properties = {
"Configuration": config,
"Platform": platform,
"IntermediateOutputPath": str(build_temp / platform / "obj") + "\\", # Must end with trailing slash.
"OutDir": str(build_temp / platform / config) + "\\",
#IntermediateOutputPath
#OutputPath
}

property_values = ';'.join(f'{k}={v}' for k, v in properties.items())
msbuild_cmd = f'msbuild -p:{property_values} {VS_PROJ}'

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

0 comments on commit 2eced23

Please sign in to comment.