Skip to content

Commit c07d0f5

Browse files
cmagliesilvanocerza
authored andcommitted
Do not try to export binaries if --only-compilation-database is set
otherwise an empty "build/fqbn/..." folder is created if "always-export-binaries" option is set via config file.
1 parent 7e1ff32 commit c07d0f5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

commands/compile/compile.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,14 @@ func Compile(ctx context.Context, req *rpc.CompileReq, outStream, errStream io.W
227227
}
228228

229229
// If the export directory is set we assume you want to export the binaries
230-
if exportBinaries || req.GetExportDir() != "" {
230+
if req.GetExportDir() != "" {
231+
exportBinaries = true
232+
}
233+
// If CreateCompilationDatabaseOnly is set, we do not need to export anything
234+
if req.GetCreateCompilationDatabaseOnly() {
235+
exportBinaries = false
236+
}
237+
if exportBinaries {
231238
var exportPath *paths.Path
232239
if exportDir := req.GetExportDir(); exportDir != "" {
233240
exportPath = paths.New(exportDir)

0 commit comments

Comments
 (0)