Skip to content

Commit

Permalink
Fix2353 - Fix active build configuration warning coming from cpptools (
Browse files Browse the repository at this point in the history
…#3267)

* Fix2353 - Fix active build configuration warning coming from cpptools

* Removed unused import that was also causing linter error

---------

Co-authored-by: Garrett Campbell <[email protected]>
  • Loading branch information
andreeis and gcampbell-msft authored Jul 31, 2023
1 parent 0054892 commit d03ed6c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 21 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Bug Fixes:
- When using CMake presets, the Project Status View now shows the build target along with the build preset. [PR #3241](https://github.com/microsoft/vscode-cmake-tools/pull/3241)
- Fix per-folder browse configurations returning incorrect information. [#3155](https://github.com/microsoft/vscode-cmake-tools/issues/3155)
- IntelliSense resolves headers coming from MacOS frameworks. CMake 3.27 or later is required. [#2324](https://github.com/microsoft/vscode-cmake-tools/issues/2324)
- Fix active build configuration warning coming from CppTools. [#2353](https://github.com/microsoft/vscode-cmake-tools/issues/2353)

Improvements:
- Decreased the number of cases where we reconfigure erroneously upon usage of `cmake.getLaunchTargetPath`. [#2878](https://github.com/microsoft/vscode-cmake-tools/issues/2878)
Expand Down
22 changes: 1 addition & 21 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import { expandString, KitContextVars } from '@cmt/expand';
import paths from '@cmt/paths';
import { CMakeDriver, CMakePreconditionProblems } from './drivers/cmakeDriver';
import { platform } from 'os';
import { defaultBuildPreset } from './preset';
import { CMakeToolsApiImpl } from './api';
import { DirectoryContext } from './workspace';
import { ProjectStatus } from './projectStatus';
Expand Down Expand Up @@ -667,26 +666,7 @@ export class ExtensionManager implements vscode.Disposable {
if (drv) {
drv.isMultiConfig = isMultiConfig;
}
const actualBuildType = await (async () => {
if (cmakeProject.useCMakePresets) {
if (isMultiConfig) {
// The `configuration` is not set on the default build preset because it is optional for single-config generators.
// If we have a multi-config generator we need to select the first value from CMAKE_CONFIGURATION_TYPES to match CMake's behavior.
if (cmakeProject.buildPreset?.name === defaultBuildPreset.name) {
const buildTypes = configurationTypes.as<string>().split(';');
if (buildTypes.length > 0) {
return buildTypes[0];
}
}
return cmakeProject.buildPreset?.configuration || null;
} else {
const buildType = cache.get('CMAKE_BUILD_TYPE');
return buildType ? buildType.as<string>() : null; // Single config generators set the build type during config, not build.
}
} else {
return cmakeProject.currentBuildType();
}
})();
const actualBuildType = await cmakeProject.currentBuildType();

const clCompilerPath = await findCLCompilerPath(configureEnv);
this.configProvider.cpptoolsVersion = cpptools.getVersion();
Expand Down

0 comments on commit d03ed6c

Please sign in to comment.