Skip to content

Commit 1537639

Browse files
committed
run ci with -DCMAKE_BUILD_TYPE=MinSizeRel
1 parent 30ccfe0 commit 1537639

File tree

5 files changed

+20
-11
lines changed

5 files changed

+20
-11
lines changed

.github/workflows/build_iar.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ jobs:
4747
run: python3 tools/get_deps.py ${{ matrix.family }}
4848

4949
- name: Build
50-
run: python3 tools/build_cmake.py ${{ matrix.family }} -DTOOLCHAIN=iar
50+
run: python3 tools/build_cmake.py ${{ matrix.family }} -DTOOLCHAIN=iar -DCMAKE_BUILD_TYPE=MinSizeRel

.github/workflows/cmake_arm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
run: python3 tools/get_deps.py ${{ matrix.family }}
7676

7777
- name: Build
78-
run: python tools/build_cmake.py ${{ matrix.family }}
78+
run: python tools/build_cmake.py ${{ matrix.family }} -DCMAKE_BUILD_TYPE=MinSizeRel
7979
env:
8080
# for rp2040, there is no harm if defined for other families
8181
PICO_SDK_PATH: ${{ github.workspace }}/pico-sdk

hw/bsp/stm32f7/family.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,19 @@ void board_init(void)
143143
GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS;
144144
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
145145

146+
// Suppress warning caused by mcu driver
147+
#ifdef __GNUC__
148+
#pragma GCC diagnostic push
149+
#pragma GCC diagnostic ignored "-Wshadow"
150+
#endif
151+
146152
/* Enable USB FS Clocks */
147153
__HAL_RCC_USB_OTG_FS_CLK_ENABLE();
148154

155+
#ifdef __GNUC__
156+
#pragma GCC diagnostic pop
157+
#endif
158+
149159
#if OTG_FS_VBUS_SENSE
150160
/* Configure VBUS Pin */
151161
GPIO_InitStruct.Pin = GPIO_PIN_9;

hw/bsp/stm32f7/family.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ CFLAGS_GCC += \
3333
-nostdlib -nostartfiles
3434

3535
# mcu driver cause following warnings
36-
CFLAGS_GCC += -Wno-error=shadow -Wno-error=cast-align
36+
CFLAGS_GCC += -Wno-error=cast-align
3737

3838
# -----------------
3939
# Sources & Include

tools/build_cmake.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,14 @@
1313

1414
build_separator = '-' * 106
1515

16-
toolchain_iar = '-DTOOLCHAIN=iar'
17-
1816
def filter_with_input(mylist):
1917
if len(sys.argv) > 1:
2018
input_args = list(set(mylist).intersection(sys.argv))
2119
if len(input_args) > 0:
2220
mylist[:] = input_args
2321

2422

25-
def build_family(family, toolchain_option):
23+
def build_family(family, cmake_option):
2624
all_boards = []
2725
for entry in os.scandir("hw/bsp/{}/boards".format(family)):
2826
if entry.is_dir() and entry.name != 'pico_sdk':
@@ -38,7 +36,7 @@ def build_family(family, toolchain_option):
3836

3937
# Generate build
4038
r = subprocess.run(f"cmake examples -B {build_dir} -G \"Ninja\" -DFAMILY={family} -DBOARD"
41-
f"={board} {toolchain_option}", shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
39+
f"={board} {cmake_option}", shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
4240

4341
# Build
4442
if r.returncode == 0:
@@ -74,9 +72,10 @@ def build_family(family, toolchain_option):
7472

7573

7674
if __name__ == '__main__':
77-
# IAR CC
78-
if toolchain_iar not in sys.argv:
79-
toolchain_iar = ''
75+
cmake_options = ''
76+
for a in sys.argv[1:]:
77+
if a.startswith('-'):
78+
cmake_options += ' ' + a
8079

8180
# If family are not specified in arguments, build all supported
8281
all_families = []
@@ -93,7 +92,7 @@ def build_family(family, toolchain_option):
9392
# succeeded, failed, skipped
9493
total_result = [0, 0, 0]
9594
for family in all_families:
96-
fret = build_family(family, toolchain_iar)
95+
fret = build_family(family, cmake_options)
9796
if len(fret) == len(total_result):
9897
total_result = [total_result[i] + fret[i] for i in range(len(fret))]
9998

0 commit comments

Comments
 (0)