|
388 | 388 | # Füge Include-Verkürzung aus REL_INC hinzu |
389 | 389 | if [[ -n "$REL_INC" ]]; then |
390 | 390 | echo " \"-iprefix\", join(FRAMEWORK_DIR, \"tools\", \"sdk\", \"$IDF_TARGET\")," >> "$AR_PLATFORMIO_PY" |
391 | | - # Konvertiere -iwithprefixbefore zu -iwithprefix |
| 391 | + # Verarbeite REL_INC korrekt - Flag und Pfad sind getrennt |
392 | 392 | IFS=' ' read -ra rel_inc_array <<< "$REL_INC" |
393 | | - for flag in "${rel_inc_array[@]}"; do |
394 | | - if [[ "$flag" == "-iwithprefixbefore"* ]]; then |
395 | | - # Konvertiere zu -iwithprefix |
396 | | - converted_flag="${flag//-iwithprefixbefore/-iwithprefix}" |
397 | | - echo " \"$converted_flag\"," >> "$AR_PLATFORMIO_PY" |
| 393 | + i=0 |
| 394 | + while [ $i -lt ${#rel_inc_array[@]} ]; do |
| 395 | + if [[ "${rel_inc_array[$i]}" == "-iwithprefixbefore" ]]; then |
| 396 | + # Nächstes Element ist der Pfad |
| 397 | + if [ $((i+1)) -lt ${#rel_inc_array[@]} ]; then |
| 398 | + path="${rel_inc_array[$((i+1))]}" |
| 399 | + echo " \"-iwithprefix/include/$path\"," >> "$AR_PLATFORMIO_PY" |
| 400 | + i=$((i+2)) # Überspringe Flag und Pfad |
| 401 | + else |
| 402 | + i=$((i+1)) |
| 403 | + fi |
| 404 | + else |
| 405 | + i=$((i+1)) |
398 | 406 | fi |
399 | 407 | done |
400 | 408 | fi |
@@ -445,13 +453,21 @@ done |
445 | 453 | # Füge Include-Verkürzung aus REL_INC hinzu |
446 | 454 | if [[ -n "$REL_INC" ]]; then |
447 | 455 | echo " \"-iprefix\", join(FRAMEWORK_DIR, \"tools\", \"sdk\", \"$IDF_TARGET\")," >> "$AR_PLATFORMIO_PY" |
448 | | - # Konvertiere -iwithprefixbefore zu -iwithprefix |
| 456 | + # Verarbeite REL_INC korrekt - Flag und Pfad sind getrennt |
449 | 457 | IFS=' ' read -ra rel_inc_array <<< "$REL_INC" |
450 | | - for flag in "${rel_inc_array[@]}"; do |
451 | | - if [[ "$flag" == "-iwithprefixbefore"* ]]; then |
452 | | - # Konvertiere zu -iwithprefix |
453 | | - converted_flag="${flag//-iwithprefixbefore/-iwithprefix}" |
454 | | - echo " \"$converted_flag\"," >> "$AR_PLATFORMIO_PY" |
| 458 | + i=0 |
| 459 | + while [ $i -lt ${#rel_inc_array[@]} ]; do |
| 460 | + if [[ "${rel_inc_array[$i]}" == "-iwithprefixbefore" ]]; then |
| 461 | + # Nächstes Element ist der Pfad |
| 462 | + if [ $((i+1)) -lt ${#rel_inc_array[@]} ]; then |
| 463 | + path="${rel_inc_array[$((i+1))]}" |
| 464 | + echo " \"-iwithprefix/include/$path\"," >> "$AR_PLATFORMIO_PY" |
| 465 | + i=$((i+2)) # Überspringe Flag und Pfad |
| 466 | + else |
| 467 | + i=$((i+1)) |
| 468 | + fi |
| 469 | + else |
| 470 | + i=$((i+1)) |
455 | 471 | fi |
456 | 472 | done |
457 | 473 | fi |
|
0 commit comments