Skip to content

Commit 322f58e

Browse files
committed
add CFLAGS_SKIP to improve sam compile time
1 parent ab0da3c commit 322f58e

File tree

10 files changed

+36
-13
lines changed

10 files changed

+36
-13
lines changed

.github/workflows/build_arm.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,8 @@ jobs:
4848
- 'stm32f0 stm32f1'
4949
- 'stm32f4'
5050
- 'stm32f7'
51-
- 'stm32g4 stm32wb'
52-
- 'stm32h7'
53-
- 'stm32l0 stm32l4'
51+
- 'stm32g4 stm32h7'
52+
- 'stm32l0 stm32l4 stm32u5 stm32wb'
5453
- 'tm4c123 xmc4000'
5554
steps:
5655
- name: Setup Python

examples/rules.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ ifeq ($(NO_LTO),1)
6666
CFLAGS := $(filter-out -flto,$(CFLAGS))
6767
endif
6868

69+
ifneq ($(CFLAGS_SKIP),)
70+
CFLAGS := $(filter-out $(CFLAGS_SKIP),$(CFLAGS))
71+
endif
72+
6973
LDFLAGS += $(CFLAGS) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections
7074

7175
ifdef LD_FILE

hw/bsp/samd11/family.mk

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,15 @@ CFLAGS += \
99
-nostdlib -nostartfiles \
1010
-DCONF_DFLL_OVERWRITE_CALIBRATION=0 \
1111
-DOSC32K_OVERWRITE_CALIBRATION=0 \
12+
-DCFG_EXAMPLE_MSC_READONLY \
13+
-DCFG_EXAMPLE_VIDEO_READONLY \
1214
-DCFG_TUSB_MCU=OPT_MCU_SAMD11
1315

1416
# suppress warning caused by vendor mcu driver
15-
CFLAGS += -Wno-error=cast-qual -Wno-error=redundant-decls
17+
CFLAGS += -Wno-error=redundant-decls
18+
19+
# SAM driver is flooded with -Wcast-qual which slow down complication significantly
20+
CFLAGS_SKIP += -Wcast-qual
1621

1722
SRC_C += \
1823
src/portable/microchip/samd/dcd_samd.c \

hw/bsp/samd21/family.mk

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ CFLAGS += \
1313
-DCFG_TUSB_MCU=OPT_MCU_SAMD21
1414

1515
# suppress warning caused by vendor mcu driver
16-
CFLAGS += -Wno-error=cast-qual -Wno-error=redundant-decls
16+
CFLAGS += -Wno-error=redundant-decls
17+
18+
# SAM driver is flooded with -Wcast-qual which slow down complication significantly
19+
CFLAGS_SKIP += -Wcast-qual
1720

1821
SRC_C += \
1922
src/portable/microchip/samd/dcd_samd.c \

hw/bsp/samd51/family.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ CFLAGS += \
1313
-nostdlib -nostartfiles \
1414
-DCFG_TUSB_MCU=OPT_MCU_SAMD51
1515

16-
# suppress warning caused by vendor mcu driver
17-
CFLAGS += -Wno-error=cast-qual
16+
# SAM driver is flooded with -Wcast-qual which slow down complication significantly
17+
CFLAGS_SKIP += -Wcast-qual
1818

1919
SRC_C += \
2020
src/portable/microchip/samd/dcd_samd.c \

hw/bsp/same5x/family.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ CFLAGS += \
1313
-nostdlib -nostartfiles \
1414
-DCFG_TUSB_MCU=OPT_MCU_SAME5X
1515

16-
# suppress warning caused by vendor mcu driver
17-
#CFLAGS += -Wno-error=cast-qual
16+
# SAM driver is flooded with -Wcast-qual which slow down complication significantly
17+
CFLAGS_SKIP += -Wcast-qual
1818

1919
SRC_C += \
2020
src/portable/microchip/samd/dcd_samd.c \

hw/bsp/same70_qmtech/board.mk

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ CFLAGS += \
1111
-DCFG_TUSB_MCU=OPT_MCU_SAMX7X
1212

1313
# suppress following warnings from mcu driver
14-
CFLAGS += -Wno-error=unused-parameter -Wno-error=cast-align -Wno-error=cast-qual -Wno-error=redundant-decls
14+
CFLAGS += -Wno-error=unused-parameter -Wno-error=cast-align -Wno-error=redundant-decls
15+
16+
# SAM driver is flooded with -Wcast-qual which slow down complication significantly
17+
CFLAGS_SKIP += -Wcast-qual
1518

1619
ASF_DIR = hw/mcu/microchip/same70
1720

hw/bsp/same70_xplained/board.mk

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ CFLAGS += \
1111
-DCFG_TUSB_MCU=OPT_MCU_SAMX7X
1212

1313
# suppress following warnings from mcu driver
14-
CFLAGS += -Wno-error=unused-parameter -Wno-error=cast-align -Wno-error=cast-qual -Wno-error=redundant-decls
14+
CFLAGS += -Wno-error=unused-parameter -Wno-error=cast-align -Wno-error=redundant-decls
15+
16+
# SAM driver is flooded with -Wcast-qual which slow down complication significantly
17+
CFLAGS_SKIP += -Wcast-qual
1518

1619
ASF_DIR = hw/mcu/microchip/same70
1720

hw/bsp/samg55xplained/board.mk

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ CFLAGS += \
1212
-DCFG_TUSB_MCU=OPT_MCU_SAMG
1313

1414
# suppress following warnings from mcu driver
15-
CFLAGS += -Wno-error=undef -Wno-error=cast-qual -Wno-error=null-dereference -Wno-error=redundant-decls
15+
CFLAGS += -Wno-error=undef -Wno-error=null-dereference -Wno-error=redundant-decls
16+
17+
# SAM driver is flooded with -Wcast-qual which slow down complication significantly
18+
CFLAGS_SKIP += -Wcast-qual
1619

1720
ASF_DIR = hw/mcu/microchip/samg55
1821

hw/bsp/saml2x/family.mk

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ CFLAGS += \
1414
-DCFG_TUSB_MCU=OPT_MCU_SAML22
1515

1616
# suppress warning caused by vendor mcu driver
17-
CFLAGS += -Wno-error=cast-qual -Wno-error=redundant-decls
17+
CFLAGS += -Wno-error=redundant-decls
18+
19+
# SAM driver is flooded with -Wcast-qual which slow down complication significantly
20+
CFLAGS_SKIP += -Wcast-qual
1821

1922
SRC_C += \
2023
src/portable/microchip/samd/dcd_samd.c \

0 commit comments

Comments
 (0)