Skip to content
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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Add prefer_clang_cl_over_msvc #1367

wants to merge 1 commit into from

Conversation

NobodyXu
Copy link
Collaborator

No description provided.

@@ -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);
Copy link
Collaborator Author

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.

Copy link
Member

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).

Copy link
Collaborator Author

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?

Copy link
Member

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.

@madsmtm madsmtm added enhancement O-windows Windows targets and toolchains labels Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement O-windows Windows targets and toolchains
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants