Skip to content

Commit 124ee2f

Browse files
setup.py: use VS 2022 toolset for Win build
1 parent edec9a4 commit 124ee2f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,15 +174,17 @@ def run(self):
174174
# Sort libs by filename length. The shortest filename should be the most generic version.
175175
lib_paths = sorted(lib_paths, key=lambda x: len(x.name))
176176
else:
177+
toolset = "v143" # Use the latest toolset available in Visual Studio 2022.
177178
platform = "x64" if IS_64_BIT else "x86"
178179
config = "Release"
179180
# Keep MSBuild outputs out of src/libusb by redirecting IntDir. libusb_dll.vcxproj derives
180181
# OutDir from IntDir, so the DLL is emitted next to this directory in a sibling "dll" dir.
181182
int_dir = build_temp / "obj"
182183
out_dir = int_dir.parent / "dll"
183184
properties = {
184-
"Configuration": config,
185+
"PlatformToolset": toolset,
185186
"Platform": platform,
187+
"Configuration": config,
186188
"IntDir": str(int_dir) + "\\", # Must end with trailing slash.
187189
}
188190
property_values = ';'.join(f'{k}={v}' for k, v in properties.items())

0 commit comments

Comments
 (0)