Skip to content

Commit

Permalink
Ensure --msvc_path and --sdk_path are used together
Browse files Browse the repository at this point in the history
Changing to a non-default MSVC version (as determined by vswhere)
requires providing both the path to the compiler and the path to the
Windows SDK.
  • Loading branch information
c0d1f1ed committed May 31, 2024
1 parent c5448e2 commit 34bd25b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions build_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,10 @@ def find_cuda_sdk():

# setup MSVC and WinSDK paths
if os.name == "nt":
if args.sdk_path and args.msvc_path:
# user provided MSVC
if args.msvc_path or args.sdk_path:
# user provided MSVC and Windows SDK
assert args.msvc_path and args.sdk_path, "--msvc_path and --sdk_path must be used together."

args.host_compiler = set_msvc_env(msvc_path=args.msvc_path, sdk_path=args.sdk_path)
else:
# attempt to find MSVC in environment (will set vcvars)
Expand Down

0 comments on commit 34bd25b

Please sign in to comment.