Closed nolanhergert closed 4 years ago
The Visual Studio generator is a multi-build generator (i.e. it generates all configs at once), so CMAKE_BUILD_TYPE is not provided in that case.
However, since some folks have desired this behavior, we recently approved PR #1393 which will add a new setting to enable this. The setting is cmake.setBuildTypeOnMultiConfig
and will be available in 1.5.0 later this month.
Brief Issue Summary
After creating a CMake Quick Start project in VSCode and picking any variant, I do not see CMAKE_BUILD_TYPE getting set to any value inside of CMakeLists.txt file (it is empty)
Expected:
message(CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE})
[cmake] CMAKE_BUILD_TYPE: Release
Apparent Behavior:
On step 3, this is what is outputted:
[cmake] CMAKE_BUILD_TYPE:
No change in behavior after deleting cache.
CMake Tools Log
Developer Tools Log
Platform and Versions
Other Notes/Information
I am able to get something in the CMAKE_BUILD_TYPE in my actual project, but it is sticky and doesn't change when I change the build variant. Deleting cache clears it, but it has inconsistent behavior afterwards. Hopefully it will reproduce on the Quick Start cmake project.