|
195 | 195 | stream_wav_file="$codebasedir"/internal_filesystem/lib/mpos/audio/stream_wav.py |
196 | 196 | sed -i.backup 's/^@micropython\.viper$/#@micropython.viper/' "$stream_wav_file" |
197 | 197 |
|
198 | | - # Suppress warnings that newer Clang (17+) treats as errors |
199 | | - echo "Temporarily suppressing Clang warnings for unix/macOS build..." |
| 198 | + # Suppress warnings that newer Clang (17+) treats as errors on macOS. |
| 199 | + # GCC on Linux doesn't have -Wgnu-folding-constant so this must be skipped there. |
200 | 200 | unix_makefile="$codebasedir"/lvgl_micropython/lib/micropython/ports/unix/Makefile |
201 | | - sed -i.backup 's/^CWARN = -Wall -Werror$/CWARN = -Wall -Werror -Wno-error=gnu-folding-constant -Wno-error=missing-field-initializers/' "$unix_makefile" |
| 201 | + if [ "$(uname -s)" = "Darwin" ]; then |
| 202 | + echo "Temporarily suppressing Clang warnings for macOS build..." |
| 203 | + sed -i.backup 's/^CWARN = -Wall -Werror$/CWARN = -Wall -Werror -Wno-error=gnu-folding-constant -Wno-error=missing-field-initializers/' "$unix_makefile" |
| 204 | + fi |
202 | 205 |
|
203 | 206 | # If it's still running, kill it, otherwise "text file busy" |
204 | 207 | pkill -9 -f /lvgl_micropy_unix |
|
223 | 226 | sed -i.backup 's/^#@micropython\.viper$/@micropython.viper/' "$stream_wav_file" |
224 | 227 | rm "$stream_wav_file".backup |
225 | 228 |
|
226 | | - # Restore original Makefile CWARN |
227 | | - echo "Restoring unix Makefile CWARN..." |
228 | | - mv "$unix_makefile".backup "$unix_makefile" |
| 229 | + # Restore original Makefile CWARN (only if we patched it on macOS) |
| 230 | + if [ -f "$unix_makefile".backup ]; then |
| 231 | + echo "Restoring unix Makefile CWARN..." |
| 232 | + mv "$unix_makefile".backup "$unix_makefile" |
| 233 | + fi |
229 | 234 | else |
230 | 235 | echo "invalid target $target" |
231 | 236 | fi |
|
0 commit comments