@@ -92,6 +92,72 @@ Global ``.h`` file: ``LowWatermark.ino.globals.h``
92
92
93
93
#endif
94
94
95
+ Separate production and debug build options
96
+ ===========================================
97
+
98
+ If your production and debug build option requirements are different,
99
+ adding ``mkbuildoptglobals.extra_flags={build.debug_port} `` to
100
+ ``platform.local.txt `` will create separate build option groups for
101
+ debugging and production. For the production build option group, the “C”
102
+ block comment starts with ``/*@create-file:build.opt@ ``, as previously
103
+ defined. For the debugging group, the new “C” block comment starts with
104
+ ``/*@create-file:build.opt:debug@ ``. You make your group selection
105
+ through “Arduino->Tools->Debug port” by selecting or disabling the
106
+ “Debug port.”
107
+
108
+ Options common to both debug and production builds must be included in
109
+ both groups. Neither of the groups is required. You may also omit either
110
+ or both.
111
+
112
+ Reminder with this change, any old “sketch” with only a “C” block
113
+ comment starting with ``/*@create-file:build.opt@ `` would not use a
114
+ ``build.opt `` file for the debug case. Update old sketches as needed.
115
+
116
+ Updated Global ``.h `` file: ``LowWatermark.ino.globals.h ``
117
+
118
+ .. code :: cpp
119
+
120
+ /*@create-file:build.opt:debug@
121
+ // Debug build options
122
+ -DMYTITLE1="\"Running on \""
123
+ -DUMM_STATS_FULL=1
124
+
125
+ //-fanalyzer
126
+
127
+ // Removing the optimization for "sibling and tail recursive calls" may fill
128
+ // in some gaps in the stack decoder report. Preserves the stack frames
129
+ // created at each level as you call down to the next.
130
+ -fno-optimize-sibling-calls
131
+ */
132
+
133
+ /*@create-file:build.opt@
134
+ // Production build options
135
+ -DMYTITLE1="\"Running on \""
136
+ -DUMM_STATS_FULL=1
137
+ -O3
138
+ */
139
+
140
+ #ifndef LOWWATERMARK_INO_GLOBALS_H
141
+ #define LOWWATERMARK_INO_GLOBALS_H
142
+
143
+ #if defined(__cplusplus)
144
+ #define MYTITLE2 "Empty"
145
+ #endif
146
+
147
+ #if !defined(__cplusplus) && !defined(__ASSEMBLER__)
148
+ #define MYTITLE2 "Full"
149
+ #endif
150
+
151
+ #ifdef DEBUG_ESP_PORT
152
+ // Global Debug defines
153
+ // ...
154
+ #else
155
+ // Global Production defines
156
+ // ...
157
+ #endif
158
+
159
+ #endif
160
+
95
161
Aggressively cache compiled core
96
162
================================
97
163
0 commit comments