Skip to content

Commit 55be128

Browse files
authored
Skip collecting optimization flag
1 parent a95a4f0 commit 55be128

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tools/copy-libs.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ for item in "${@:2:${#@}-5}"; do
9292
if [[ "${item:2:7}" != "ARDUINO" ]] && [[ "$item" != "-DESP32" ]]; then #skip ARDUINO defines
9393
DEFINES+="$item "
9494
fi
95+
elif [ "$prefix" = "-O" ]; then
96+
PIO_CC_FLAGS+="$item "
9597
elif [[ "$item" != "-Wall" && "$item" != "-Werror=all" && "$item" != "-Wextra" ]]; then
9698
if [[ "${item:0:23}" != "-mfix-esp32-psram-cache" && "${item:0:18}" != "-fmacro-prefix-map" ]]; then
9799
C_FLAGS+="$item "
@@ -106,7 +108,7 @@ str=`printf '%b' "$str"` #unescape the string
106108
set -- $str
107109
for item in "${@:2:${#@}-5}"; do
108110
prefix="${item:0:2}"
109-
if [[ "$prefix" != "-I" && "$prefix" != "-D" && "$item" != "-Wall" && "$item" != "-Werror=all" && "$item" != "-Wextra" ]]; then
111+
if [[ "$prefix" != "-I" && "$prefix" != "-D" && "$item" != "-Wall" && "$item" != "-Werror=all" && "$item" != "-Wextra" && "$prefix" != "-O" ]]; then
110112
if [[ "${item:0:23}" != "-mfix-esp32-psram-cache" && "${item:0:18}" != "-fmacro-prefix-map" ]]; then
111113
AS_FLAGS+="$item "
112114
if [[ $C_FLAGS == *"$item"* ]]; then
@@ -125,7 +127,7 @@ str=`printf '%b' "$str"` #unescape the string
125127
set -- $str
126128
for item in "${@:2:${#@}-5}"; do
127129
prefix="${item:0:2}"
128-
if [[ "$prefix" != "-I" && "$prefix" != "-D" && "$item" != "-Wall" && "$item" != "-Werror=all" && "$item" != "-Wextra" ]]; then
130+
if [[ "$prefix" != "-I" && "$prefix" != "-D" && "$item" != "-Wall" && "$item" != "-Werror=all" && "$item" != "-Wextra" && "$prefix" != "-O" ]]; then
129131
if [[ "${item:0:23}" != "-mfix-esp32-psram-cache" && "${item:0:18}" != "-fmacro-prefix-map" ]]; then
130132
CPP_FLAGS+="$item "
131133
if [[ $PIO_CC_FLAGS != *"$item"* ]]; then

0 commit comments

Comments
 (0)