-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
CMakeLists.txt Use CMakePresets instead of CMakeSettings #3730
Conversation
…er ordinarily used it.
Co-authored-by: Michael Schellenberger Costa <miscco@nvidia.com>
Thanks, this is a really nice improvement! I pushed the following changes:
I've manually tested configure/build/test on the 4 architectures, and building the clang-format target ( There is potential future work to make a "benchmark" target, so we can simplify those configure/build commands, but that would be entirely separate and best done in a followup PR. |
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.
This breaks VSCode's CMakeTools addon.
CMakeTools has "odd" requirements when it comes to how the archtecture and toolset items are specified, and you also need to set CMAKE_CXX_COMPILER
to cl.exe
to get it to add visual studio to the search path before running cmake.
I'll try and submit suggestions once I get things working on both VS and VSCode.
In particular both the arch and toolset items must be specified in each configure preset (you can't consolidate them into a parent) and they must be literals, they can't contain any substitutions. Also VS and VSCode seem to have somewhat different conventions for how the toolset value is interpreted, I'm trying to find a way that'll work in both. |
Yeah I can't get this to work in my copy of Visual Studio at all, either the latest 17.7 preview 1, or the internal dogfooding version. It seems that developer command prompt environment variables are around for the configure step but don't get set for the build step, so the compiler can't find any of the usual include files. When you tested this out did you launch visual studio from a developer command prompt? |
This bug is classified as high priority internally, hopefully it'll be fixed fairly rapidly. |
I've pushed changes to go back to version 5 and un-consolidate the architecture.
Note that we can't ever support using anything older than the latest Preview because we continually need the latest compiler features and fixes. Right now we don't have a hard
As DevCom-10365917 / internal VSO-1822085 is being prioritized for 17.7 Preview 3 (no promises!), I'll move this PR to the blocked state until then. |
A fix has been merged for 17.7 Preview 3. |
This comment was marked as resolved.
This comment was marked as resolved.
@barcharcraz will take a look at this next week and validate that VSCode's CMakeTools is happy with this. |
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.
This still doesn't work with vscode, no matter what config you select it will always use the x64 tools, or whatever else it can find on the path.
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.
We discussed this in the maintainer meeting and given that vscode cmake tools is pretty broken, and that this offers advantages for command line compilation, we're going to accept and merge this.
Improvements can be made later as well
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Thanks for simplifying the repo building experience, and congratulations on your first microsoft/STL commit! ⚙️ 🎉 😻 |
Thanks. |
CMakeSettings is the older style for setting up CMake and standard CMake is encouraged to use CMakePresets instead. I've not modified the CI scripts yet but they could now be changed to use the new presets. I've verified x86 and x64 building on my system through VS (I've not got ARM build tools installed). I updated the readme to direct towards the presets but you could also continue using the old style. You don't actually need to run from the Native Tools Command Prompt just from a regular Command Prompt will now work.