-
Notifications
You must be signed in to change notification settings - Fork 468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configuration from build presets ignored by Intellisense and launch #2099
Comments
@xisui-MSFT could you take a look at this one? |
I've had the same problem. Looking forward to the fix. The workaround I'm using is defining Adding to the Preset above it would go like this.
|
@pilarArr This only works around the problem in the original issue partially. Although launch would follow the type set in CMAKE_BUILD_TYPE, intellisense would still be wrong. Definitions like |
This fix is included in the 1.9.0 CMake Tools release. Please upgrade your extension in VSCode and let us know if you encounter any other issues. |
Brief Issue Summary
When a multi-configuration generator is used, switching between build presets with different
configuration
field does not have any effect on Intellisense and on running a target.Could be a duplicate of #2048, though presets are not mentioned there.
Expected:
When a build preset specifying a
configuration
is selected within a multi-configuration generator, the Intellisense should update accordingly, e.g. greying out configuration-specific macros, and when a target is run, the corresponding configuration should be run.Apparent Behavior:
Independently of the configuration explicitly set in the build preset, Intellisense and launch stick to one specific configuration (e.g. Debug for Visual Studio 2017, or Release for Ninja Multi-Config on Linux).
CMake Tools Log
Despite a preset with configuration
Release
was selected, the target was run with cwd being theDebug
subdirectory (which had not been built).Minimal files to reproduce the issue:
settings.json:
CMakePresets.json (Here Visual Studio 2017 is considered, though Ninja Multi-Config shows the same behavior on Linux):
CMakeLists.txt:
main.cpp (Intellisense does not grey out the code according to the configuration selected):
Platform and Versions
The text was updated successfully, but these errors were encountered: