Skip to content

Add documentation regarding the "unspecified" architecture feature #3282

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 7 commits into from
Aug 10, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/build/cmake-presets-vs.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@ The `architecture.strategy` and `toolset.strategy` values tell CMake how to hand

You should use `set` with IDE generators like the Visual Studio Generator. You should use `external` with command-line generators like Ninja. These values allow vendors like Visual Studio to source the required environment before CMake is invoked. For more information about the architecture and toolset fields, see the [list of Configure Presets](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html#configure-preset).

Additionally, if you do not want any environment sourced, you can set architecture.value to "unspecified" and architecture.strategy to "external". However, you can only do this if you have Ninja set as the generator. Not having any environment sourced could be useful in cases where you are using a toolset other than MSVC where you don't need a specific environment in order to build, or you are in a linux/non-Windows environment.
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this have to been used with Ninja? I thought it would apply to any command-line generator.

Copy link
Contributor Author

@gcampbell-msft gcampbell-msft Aug 9, 2021

Choose a reason for hiding this comment

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

This was based on @bobbrow notes regarding this PR in our email chain saying that the Ninja generator was a requirement.


For a full list of IDE generators that support the architecture field, see [`CMAKE_GENERATOR_PLATFORM`](https://cmake.org/cmake/help/latest/variable/CMAKE_GENERATOR_PLATFORM.html). For a full list of IDE generators that support the toolset field, see [`CMAKE_GENERATOR_TOOLSET`](https://cmake.org/cmake/help/latest/variable/CMAKE_GENERATOR_TOOLSET.html).

Use the following examples to target ARM64 with the Ninja generator, or to target Win32 (x86) with the Visual Studio 16 2019 generator:
Expand Down