File tree Expand file tree Collapse file tree 3 files changed +15
-5
lines changed
Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -17,12 +17,19 @@ configure a list of bazel labels for the `cc_binary` or `cc_library` targets
1717you'd like to be indexed. The tool will then produce a command set for the
1818transitive 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
2125follows:
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" ,
Original file line number Diff line number Diff line change 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"
Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments