48
48
verify bool // Upload, verify uploaded binary after the upload.
49
49
exportFile string // The compiled binary is written to this file
50
50
libraries []string // List of custom libraries paths separated by commas. Or can be used multiple times for multiple libraries paths.
51
+ optimizeForDebug bool // Optimize compile output for debug, not for release
51
52
)
52
53
53
54
// NewCommand created a new `compile` command
@@ -80,6 +81,7 @@ func NewCommand() *cobra.Command {
80
81
command .Flags ().StringVar (& vidPid , "vid-pid" , "" , "When specified, VID/PID specific build properties are used, if boards supports them." )
81
82
command .Flags ().StringSliceVar (& libraries , "libraries" , []string {},
82
83
"List of custom libraries paths separated by commas. Or can be used multiple times for multiple libraries paths." )
84
+ command .Flags ().BoolVar (& optimizeForDebug , "optimize-for-debug" , false , "Optional, optimize compile output for debug, not for release." )
83
85
84
86
return command
85
87
}
@@ -99,20 +101,21 @@ func run(cmd *cobra.Command, args []string) {
99
101
sketchPath := initSketchPath (path )
100
102
101
103
_ , err = compile .Compile (context .Background (), & rpc.CompileReq {
102
- Instance : inst ,
103
- Fqbn : fqbn ,
104
- SketchPath : sketchPath .String (),
105
- ShowProperties : showProperties ,
106
- Preprocess : preprocess ,
107
- BuildCachePath : buildCachePath ,
108
- BuildPath : buildPath ,
109
- BuildProperties : buildProperties ,
110
- Warnings : warnings ,
111
- Verbose : verbose ,
112
- Quiet : quiet ,
113
- VidPid : vidPid ,
114
- ExportFile : exportFile ,
115
- Libraries : libraries ,
104
+ Instance : inst ,
105
+ Fqbn : fqbn ,
106
+ SketchPath : sketchPath .String (),
107
+ ShowProperties : showProperties ,
108
+ Preprocess : preprocess ,
109
+ BuildCachePath : buildCachePath ,
110
+ BuildPath : buildPath ,
111
+ BuildProperties : buildProperties ,
112
+ Warnings : warnings ,
113
+ Verbose : verbose ,
114
+ Quiet : quiet ,
115
+ VidPid : vidPid ,
116
+ ExportFile : exportFile ,
117
+ Libraries : libraries ,
118
+ OptimizeForDebug : optimizeForDebug ,
116
119
}, os .Stdout , os .Stderr , viper .GetString ("logging.level" ) == "debug" )
117
120
118
121
if err != nil {
0 commit comments