generate visual studio 2019 arch default

Q1
IMAGE

Is the arch defaut 32bit-build ?

Q2
The command line cmake -G "Visual Studio 16 2019" will generate a Visual Studio .sln file for a 32-bit build?
If it is, should I command the cmake -G "Visual Studio 16 2019" -A Win64 for a 64-bit build

The default changed to “the same as the host” around 2019 I think. If you want to be explicit, -A x64 is the way to go.

@brad.king

1 Like

@ben.boeckel is correct. Here are the docs for reference.

VS2017 uses x86 host by default

VS2019+ uses x64 host by default:
https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2016%202019.html?highlight=host#toolset-selection
https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2017%202022.html?highlight=host#toolset-selection