# No way to set Visual Studio generation to use \`EnableEnhancedInstructionSet\` with a value of \`NotSet\`

**URL:** https://discourse.cmake.org/t/no-way-to-set-visual-studio-generation-to-use-enableenhancedinstructionset-with-a-value-of-notset/8892
**Category:** Code
**Tags:** gen:vs
**Created:** [September 5, 2023, 10:16pm UTC](https://discourse.cmake.org/t/no-way-to-set-visual-studio-generation-to-use-enableenhancedinstructionset-with-a-value-of-notset/8892 "2023-09-05T22:16:16Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![StewMcC](https://discourse.cmake.org/user_avatar/discourse.cmake.org/stewmcc/32/3787_2.png) [@StewMcC](https://discourse.cmake.org/u/StewMcC)
#### Post date: [September 5, 2023, 10:16pm UTC](https://discourse.cmake.org/t/no-way-to-set-visual-studio-generation-to-use-enableenhancedinstructionset-with-a-value-of-notset/8892/1 "2023-09-05T22:16:16Z")

</div>

I have a project that wishes to set EnableEnhancedInstructionSet to a “NotSet” value for visual studio generation, I currently have to handle this via VS\_USER\_PROPS, which seems a bit like a hack.

On testing noticed that exposing /arch:NotSet on the relevant flagtables `Templates/MSBuild/FlagTables/v143_CL.json` I was able to get the desired result which seemed a lot cleaner. EnableEnhancedInstructionSet value explicitly set to NotSet in all relevant vcxproj files.

I am currently trying to figure out what is causing it to default to AVX2, as it seems to be the default option in vs2022 when the EnableEnhancedInstructionSet isn’t found for the vcxproj, instead of NotSet 😕. When using command line directly, not specifying ofc treats it as NotSet.

Is VS\_USER\_PROPS the “correct” way to fix this, or is modifying the flagtables.json a viable option?

- This is just for one x64 platform target of many being ported, so possibly over simplifying the problem.

---

<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: [September 6, 2023, 12:16pm UTC](https://discourse.cmake.org/t/no-way-to-set-visual-studio-generation-to-use-enableenhancedinstructionset-with-a-value-of-notset/8892/2 "2023-09-06T12:16:35Z")

</div>

I think this may be something that makes sense for CMake to expose.

Cc: @brad.king

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [September 6, 2023, 2:17pm UTC](https://discourse.cmake.org/t/no-way-to-set-visual-studio-generation-to-use-enableenhancedinstructionset-with-a-value-of-notset/8892/3 "2023-09-06T14:17:30Z")

</div>

> [@StewMcC](#):
>
> exposing /arch:NotSet on the relevant flagtables `Templates/MSBuild/FlagTables/v143_CL.json` I was able to get the desired result

I’d welcome a merge request that adds such flag table entries.

---

<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: [September 6, 2023, 8:23pm UTC](https://discourse.cmake.org/t/no-way-to-set-visual-studio-generation-to-use-enableenhancedinstructionset-with-a-value-of-notset/8892/4 "2023-09-06T20:23:26Z")

</div>

> [@brad.king](#):
>
> that adds such flag table entries.

See [this directory](https://gitlab.kitware.com/cmake/cmake/-/tree/master/Templates/MSBuild/FlagTables).

---

<div class="post-metadata">

### Author: ![StewMcC](https://discourse.cmake.org/user_avatar/discourse.cmake.org/stewmcc/32/3787_2.png) [@StewMcC](https://discourse.cmake.org/u/StewMcC)
#### Post date: [September 26, 2023, 11:30pm UTC](https://discourse.cmake.org/t/no-way-to-set-visual-studio-generation-to-use-enableenhancedinstructionset-with-a-value-of-notset/8892/5 "2023-09-26T23:30:29Z")

</div>

Merge of the changes been using for a wee while: [https://gitlab.kitware.com/cmake/cmake/-/merge\_requests/8843](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/8843) not sure if you want the other \_CL.json files updated as well (that have the EnableEnhancedInstructionSet already) as can’t test or use them myself.
