# generate visual studio 2019 arch default

**URL:** https://discourse.cmake.org/t/generate-visual-studio-2019-arch-default/5010
**Category:** Usage
**Tags:** os:windows
**Created:** [February 15, 2022, 9:20am UTC](https://discourse.cmake.org/t/generate-visual-studio-2019-arch-default/5010 "2022-02-15T09:20:12Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![alice](https://discourse.cmake.org/user_avatar/discourse.cmake.org/alice/32/1615_2.png) [@alice](https://discourse.cmake.org/u/alice)
#### Post date: [February 15, 2022, 9:20am UTC](https://discourse.cmake.org/t/generate-visual-studio-2019-arch-default/5010/1 "2022-02-15T09:20:13Z")

</div>

Q1  
IMAGE

> **[How to Build a CMake-Based Project](https://preshing.com/20170511/how-to-build-a-cmake-based-project/#running-cmake-from-the-command-line)**
>
> CMake is a versatile tool that helps you build C/C++ projects on just about any platform you can think of. It's used by many popular open source projects including LLVM, Qt, KDE …

 ![image](https://discourse.cmake.org/uploads/default/original/2X/c/cdc367ed62beddf5c65184b12140e17b27b8a0c9.png)

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

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [February 15, 2022, 2:16pm UTC](https://discourse.cmake.org/t/generate-visual-studio-2019-arch-default/5010/2 "2022-02-15T14:16:22Z")

</div>

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

---

<div class="post-metadata">

### Author: ![buildSystemPerson](https://discourse.cmake.org/user_avatar/discourse.cmake.org/buildsystemperson/32/2851_2.png) [@buildSystemPerson](https://discourse.cmake.org/u/buildSystemPerson)
#### Post date: [February 15, 2022, 2:59pm UTC](https://discourse.cmake.org/t/generate-visual-studio-2019-arch-default/5010/3 "2022-02-15T14:59:04Z")

</div>

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

VS2017 uses x86 host by [default](https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2015%202017.html?highlight=host#toolset-selection)

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%2016%202019.html?highlight=host#toolset-selection)  
[https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2017%202022.html?highlight=host#toolset-selection](https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2017%202022.html?highlight=host#toolset-selection)
