Skip to content
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

Normalize the case before comparing compilation database paths (#4207) #4209

Merged
merged 2 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Bug Fixes:
- Ensure that tests are updated after a build. [#4148](https://github.com/microsoft/vscode-cmake-tools/pull/4148)
- Fix various GCC compiler errors and GCC linker errors not showing up in Problems View [#2864](https://github.com/microsoft/vscode-cmake-tools/issues/2864)
- Fix reloading presets when included files are changed or renamed and updated. [#3963](https://github.com/microsoft/vscode-cmake-tools/issues/3963)
- Fix compilation database path comparison with the `cmake.copyCompileCommands` that could otherwise overwrite that file. [#4207](https://github.com/microsoft/vscode-cmake-tools/issues/4207) [@k0zmo](https://github.com/k0zmo)
- Fix parsing of CMakeUserPresets.json containing configure preset that is referenced in workflow preset. [#4202](https://github.com/microsoft/vscode-cmake-tools/pull/4202)

## 1.19.52
Expand Down
4 changes: 2 additions & 2 deletions src/cmakeProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1541,13 +1541,13 @@ export class CMakeProject {
}
} else {
// single file with known path
const compdbPath = util.lightNormalizePath(path.join(await this.binaryDir, 'compile_commands.json'));
const compdbPath = util.platformNormalizePath(path.join(await this.binaryDir, 'compile_commands.json'));
if (await fs.exists(compdbPath)) {
compdbPaths.push(compdbPath);
if (this.workspaceContext.config.copyCompileCommands) {
// Now try to copy the compdb to the user-requested path
const copyDest = util.lightNormalizePath(this.workspaceContext.config.copyCompileCommands);
const expandedDest = util.lightNormalizePath(await expandString(copyDest, opts));
const expandedDest = util.platformNormalizePath(await expandString(copyDest, opts));
if (compdbPath !== expandedDest) {
const parentDir = path.dirname(expandedDest);
try {
Expand Down