Skip to content

Commit 18c8af0

Browse files
authored
Release 1.1.1 (#6)
1 parent aa43b1e commit 18c8af0

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,19 @@ configure a list of bazel labels for the `cc_binary` or `cc_library` targets
1717
you'd like to be indexed. The tool will then produce a command set for the
1818
transitive closure of those top-level targets.
1919

20-
This can be added to your `.vscode/settings.json` and checked-in to VCS as
20+
To configure the bazel executable and/or additional bazel build arguments, use
21+
the `bsv.bazel.executable` and `bsv.bazel.buildFlags` settings (provided by
22+
[bazel-stack-vscode](https://marketplace.visualstudio.com/items?itemName=StackBuild.bazel-stack-vscode)).
23+
24+
These can be added to your `.vscode/settings.json` and checked-in to VCS as
2125
follows:
2226

2327
```json
2428
{
2529
...
30+
"bsv.bazel.buildFlags": [
31+
"--config=custom",
32+
],
2633
"bsv.cc.compdb.targets": [
2734
"//app/foo:foo_binary",
2835
"//app/bar:bar_binary",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "bazel-stack-vscode-cc",
44
"displayName": "bazel-stack-vscode-cc",
55
"description": "C/C++ Support For Bazel Stack VSCode Extension",
6-
"version": "1.1.0",
6+
"version": "1.1.1",
77
"icon": "stackb-cc.png",
88
"engines": {
99
"vscode": "^1.45.0"

src/compilationDatabase.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,15 @@ export class CompilationDatabase implements vscode.Disposable {
2323
}
2424

2525
const bazelConfig = vscode.workspace.getConfiguration('bsv.bazel');
26-
const bazelExecutable = bazelConfig.get<string>('executable', 'bazel');
27-
const bazelBuildArgs = bazelConfig.get<string[]>('buildArgs', []);
26+
let bazelExecutable = bazelConfig.get<string | undefined>('executable');
27+
if (!bazelExecutable) {
28+
bazelExecutable = 'bazel';
29+
}
30+
const buildFlags = bazelConfig.get<string[]>('buildFlags', []);
2831

2932
vscode.window.showInformationMessage('Building clang compilation database for ' + JSON.stringify(targets));
3033

31-
return vscode.tasks.executeTask(this.createGenerateTask(targets, bazelExecutable, bazelBuildArgs));
34+
return vscode.tasks.executeTask(this.createGenerateTask(targets, bazelExecutable, buildFlags));
3235
}
3336

3437
createGenerateTask(targets: string[], bazelExecutable: string, buildArgs: string[]): vscode.Task {

0 commit comments

Comments
 (0)