Skip to content

Commit

Permalink
Merge branch 'main' into dev/andris/cmake_tools/fix2368_wrong_bad_cma…
Browse files Browse the repository at this point in the history
…ke_exe
  • Loading branch information
andreeis authored Jul 31, 2023
2 parents 0677d9f + d03ed6c commit 58868e6
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 @@ -10,6 +10,7 @@ Bug Fixes:
- 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 triggers of "Bad CMake Executable" error message. [#2368](https://github.com/microsoft/vscode-cmake-tools/issues/2368)
- 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 58868e6

Please sign in to comment.