4848 verify bool // Upload, verify uploaded binary after the upload.
4949 exportFile string // The compiled binary is written to this file
5050 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
5152)
5253
5354// NewCommand created a new `compile` command
@@ -80,6 +81,7 @@ func NewCommand() *cobra.Command {
8081 command .Flags ().StringVar (& vidPid , "vid-pid" , "" , "When specified, VID/PID specific build properties are used, if boards supports them." )
8182 command .Flags ().StringSliceVar (& libraries , "libraries" , []string {},
8283 "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." )
8385
8486 return command
8587}
@@ -99,20 +101,21 @@ func run(cmd *cobra.Command, args []string) {
99101 sketchPath := initSketchPath (path )
100102
101103 _ , 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 ,
116119 }, os .Stdout , os .Stderr , viper .GetString ("logging.level" ) == "debug" )
117120
118121 if err != nil {
0 commit comments