# How to make a visual studio solution with x64/x86 support?

**URL:** https://discourse.cmake.org/t/how-to-make-a-visual-studio-solution-with-x64-x86-support/880
**Category:** Usage
**Tags:** os:windows, gen:vs
**Created:** [March 28, 2020, 1:48am UTC](https://discourse.cmake.org/t/how-to-make-a-visual-studio-solution-with-x64-x86-support/880 "2020-03-28T01:48:39Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![YMba9g8j9CJp0wLoQf5y](https://discourse.cmake.org/user_avatar/discourse.cmake.org/ymba9g8j9cjp0wloqf5y/32/1244_2.png) [@YMba9g8j9CJp0wLoQf5y](https://discourse.cmake.org/u/YMba9g8j9CJp0wLoQf5y)
#### Post date: [March 28, 2020, 1:48am UTC](https://discourse.cmake.org/t/how-to-make-a-visual-studio-solution-with-x64-x86-support/880/1 "2020-03-28T01:48:39Z")

</div>

Just like the question says I want to create a visual studio solution that supports both x64/x86.

Is this possible?

Also is it possible to make a singular visual studio solution that supports 2 toolchains?

---

<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: [March 28, 2020, 12:44pm UTC](https://discourse.cmake.org/t/how-to-make-a-visual-studio-solution-with-x64-x86-support/880/2 "2020-03-28T12:44:23Z")

</div>

CMake does not support multiple toolchains in a single build tree, so this is not possible. You’ll need two build trees for this.

---

<div class="post-metadata">

### Author: ![hsattler](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/h/59ef9b/32.png) [@hsattler](https://discourse.cmake.org/u/hsattler)
#### Post date: [March 28, 2020, 1:23pm UTC](https://discourse.cmake.org/t/how-to-make-a-visual-studio-solution-with-x64-x86-support/880/3 "2020-03-28T13:23:18Z")

</div>

Opening the CMake source tree directly in Visual Studio 2017 or later can do this. I found it pretty unstable, though.

---

<div class="post-metadata">

### Author: ![anon45792294](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/a587f6/32.png) [@anon45792294](https://discourse.cmake.org/u/anon45792294)
#### Post date: [March 29, 2020, 5:55am UTC](https://discourse.cmake.org/t/how-to-make-a-visual-studio-solution-with-x64-x86-support/880/4 "2020-03-29T05:55:02Z")

</div>

@hsattler what do you mean “opening the cmake source tree directly in Visual Studio 2017”?

Are you referring to Visual Studios cmake support via CMakeSetttings.json?

---

<div class="post-metadata">

### Author: ![hsattler](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/h/59ef9b/32.png) [@hsattler](https://discourse.cmake.org/u/hsattler)
#### Post date: [March 29, 2020, 6:30am UTC](https://discourse.cmake.org/t/how-to-make-a-visual-studio-solution-with-x64-x86-support/880/5 "2020-03-29T06:30:40Z")

</div>

Yes. That’s currently the only way to have it in one VS solution.

---

<div class="post-metadata">

### Author: ![anon45792294](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/a587f6/32.png) [@anon45792294](https://discourse.cmake.org/u/anon45792294)
#### Post date: [March 29, 2020, 7:22am UTC](https://discourse.cmake.org/t/how-to-make-a-visual-studio-solution-with-x64-x86-support/880/7 "2020-03-29T07:22:51Z")

</div>

I understand for most generators it doesn’t make sense to support multiple toolchains.

However, I think Visual Studio should be the exception. Since most people except to be able to build 32/64 bit application with visual studio.

---

<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: [March 29, 2020, 4:55pm UTC](https://discourse.cmake.org/t/how-to-make-a-visual-studio-solution-with-x64-x86-support/880/8 "2020-03-29T16:55:07Z")

</div>

> [@anon45792294](#):
>
> However, I think Visual Studio should be the exception. Since most people except to be able to build 32/64 bit application with visual studio.

It’s a fundamental limitation to CMake. What is the value of `CMAKE_SYSTEM_PROCESSOR` with two toolchains? CMake would need lots of work to support such a workflow.

---

<div class="post-metadata">

### Author: ![hsattler](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/h/59ef9b/32.png) [@hsattler](https://discourse.cmake.org/u/hsattler)
#### Post date: [March 29, 2020, 6:22pm UTC](https://discourse.cmake.org/t/how-to-make-a-visual-studio-solution-with-x64-x86-support/880/9 "2020-03-29T18:22:23Z")

</div>

The generation step creates the solution files. That currently involves exactly one configure step. It could involve two or more.

It probably is still a lot if work but there is no fundamental conflict to the CMake concept.

The current user interface doesn’t fit such a use case though.

---

<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: [March 29, 2020, 7:35pm UTC](https://discourse.cmake.org/t/how-to-make-a-visual-studio-solution-with-x64-x86-support/880/10 "2020-03-29T19:35:34Z")

</div>

> [@hsattler](#):
>
> It probably is still a lot if work but there is no fundamental conflict to the CMake concept.

Concept? Probably not. Implementation, very much so 🙂 .
