Skip to content

Update cmake-presets-vs.md #3447

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

Merged
merged 4 commits into from
Dec 15, 2021
Merged

Conversation

sweemer
Copy link
Contributor

@sweemer sweemer commented Oct 10, 2021

Add instructions for configuring clang-cl with the ClangCL toolset configure preset instead of by setting CMAKE_C_COMPILER and CMAKE_CXX_COMPILER in cacheVariables.

Fixes #3446.

Add instructions for configuring clang-cl with the ClangCL toolset configure preset instead of by setting CMAKE_C_COMPILER and CMAKE_CXX_COMPILER in cacheVariables.
@ghost
Copy link

ghost commented Oct 10, 2021

CLA assistant check
All CLA requirements met.

@PRMerger15
Copy link
Contributor

@sweemer : Thanks for your contribution! The author(s) have been notified to review your proposed change.

@ktoliver
Copy link
Contributor

#label:"aq-pr-triaged"

@PRMerger8 PRMerger8 added the aq-pr-triaged Tracking label for the PR review team label Oct 11, 2021
@colin-home
Copy link
Contributor

@bobbrow Do you have a delegate who can review this change and the related issue #3446? I've let this go too long without a ping.

@sfreed141
Copy link
Contributor

I commented on the original issue too, but I don't believe ClangCL is a valid toolset for the Visual Studio generators.
image

@sweemer did using ClangCL as the toolset work for you? If so can you share your VS and CMake versions?

"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}",
},
"toolset": "ClangCL",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assumes the current generator supports specifying toolsets (see docs for more info). For the Ninja generator this preset is invalid.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. I have pushed up a new commit to clarify that not all generators support this preset.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating that. However I don't think ClangCl will be valid until the Visual Studio 16 2019 generator, since LLVM was added in version 16.1. Also I'd be more explicit that this is only for Visual Studio generators. perhaps

if you are using either Visual Studio 16 2019 or Visual Studio 17 2022 as your generator, you can use the toolset property in the configure preset to specify the ClangCL toolset:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@PRMerger12
Copy link
Contributor

@sweemer : Thanks for your contribution! The author(s) have been notified to review your proposed change.

@sfreed141
Copy link
Contributor

Just copying this over here from the issue:
I dug into why it wasn't working for me and it's because of microsoft/vcpkg#15623 :( After I removed vcpkg using ClangCl for the toolset works. I believe it only works for the VS generators though (based on this bit in CMake source)

@PRMerger6
Copy link
Contributor

@sweemer : Thanks for your contribution! The author(s) have been notified to review your proposed change.

@PRMerger4
Copy link
Contributor

@corob-msft : Thanks for your contribution! The author(s) have been notified to review your proposed change.

@colin-home colin-home merged commit f8f8d17 into MicrosoftDocs:main Dec 15, 2021
@colin-home
Copy link
Contributor

@sweemer Thanks for the contribution, and for your patience and collaboration. Thanks to @sfreed141 too, for verifying and suggestions.

@sweemer sweemer deleted the cmake-presets-vs branch December 15, 2021 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update CMake Presets for compiling with clang-cl
9 participants