-
Notifications
You must be signed in to change notification settings - Fork 472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add prefer_clang_cl_over_msvc #1367
base: main
Are you sure you want to change the base?
Conversation
@@ -2748,7 +2765,7 @@ impl Build { | |||
traditional | |||
}; | |||
|
|||
let cl_exe = self.windows_registry_find_tool(&target, "cl.exe"); | |||
let cl_exe = self.windows_registry_find_tool(&target, msvc); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @ChrisDenton I would need some help on how to find clang-cl
, here I just pass clang-cl.exe
to windows_registry::find_tool
if user prefers clang-cl over msvc, hoping it would find it, not sure if it is correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That might find it if it's installed with Visual Studio but it could be installed separately. We should more strongly prefer the environment for clang-cl
(e.g. checking PATH
as well).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should add I a dedicated PATH
checking logic for clang-cl.exe
?
Or should I add that to windows_registry::find_tool
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think adding dedicated PATH
checking logic is the safest option.
It'd be nice if find_tool
where consistent but it's possible people may use it to specifically find the VS installed version. So unless someone complains about the find_tool
behaviour, I'm not sure if it's worth the (admittedly small) risk of breakage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That might find it if it's installed with Visual Studio but it could be installed separately. We should more strongly prefer the environment for clang-cl (e.g. checking PATH as well).
If it is installed separately then the user should specify CC
/TARGET_CC
when building. Otherwise, I think the behavior should be "use the clang-cl provided with the version of MSVC that we were about to use."
No description provided.