Fix a few problems in the windows-vs-* presets#109
Merged
MarkSchofield merged 4 commits intomainfrom Sep 8, 2024
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It turns out that #107 was perhaps a bit rushed. Here's some fixes from trying out the presets:
'windows-vs-*' preset should inherit from 'windows-vs' - I typo'd. The 'windows-vs-*' presets should've inherited from 'windows-vs' - just to follow the precedent I've set-up in
CMakePresets.json. 'windows-vs' was just setting the generator as 'Visual Studio 17 2022', which - it turns out - is the default on Windows, so there's no functional difference here. But being explicit in the generator would be my preference, to make sure that folks don't accidentally pick-up a new one on CMake update.Set the windows-vs* target architecture using 'CMAKE_GENERATOR_PLATFORM', not 'CMAKE_SYSTEM_PROCESSOR' - The Visual Studio Generators expect
CMAKE_GENERATOR_PLATFORMto set the target processor architecture, notCMAKE_SYSTEM_PROCESSOR. Again (since I'm building on x64), the default made me think it was working. The ARM64 build, however, was building for x64, which is broken. The Visual Studio Generators also get told of the Windows SDK through theCMAKE_GENERATOR_PLATFORMvalue, which I hadn't realized. It's a bit awkward - it makes it harder to configure/choose an SDK, but I suppose it's at least clear.Use CMAKE_SYSTEM_PROCESSOR 'X86', not 'x86' I should've cleaned-up my
x86CMAKE_SYSTEM_PROCESSORvalue toX86. Fixing that now.Give the windows-vs-* presets better names - I've been using VSCode's CMake support a bit more (not just command-line CMake'ing), and the
displayNameof the preset is surfaced prominently, and highlights that the values weren't particularly useful. Fixing that.