summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2023-06-25 00:05:23 +0700
committerhathach <[email protected]>2023-06-25 00:05:23 +0700
commit15376397b10e6fb35ef7ec4b693271adbafecabf (patch)
tree1530a5a69045fbd75d9b1676ffd093a51869850d
parent30ccfe083216f5219bfa8e85e0a0a26547a2655c (diff)
run ci with -DCMAKE_BUILD_TYPE=MinSizeRel
-rw-r--r--.github/workflows/build_iar.yml2
-rw-r--r--.github/workflows/cmake_arm.yml2
-rw-r--r--hw/bsp/stm32f7/family.c10
-rw-r--r--hw/bsp/stm32f7/family.mk2
-rw-r--r--tools/build_cmake.py15
5 files changed, 20 insertions, 11 deletions
diff --git a/.github/workflows/build_iar.yml b/.github/workflows/build_iar.yml
index 6273385e7..4c5fd770c 100644
--- a/.github/workflows/build_iar.yml
+++ b/.github/workflows/build_iar.yml
@@ -47,4 +47,4 @@ jobs:
run: python3 tools/get_deps.py ${{ matrix.family }}
- name: Build
- run: python3 tools/build_cmake.py ${{ matrix.family }} -DTOOLCHAIN=iar
+ run: python3 tools/build_cmake.py ${{ matrix.family }} -DTOOLCHAIN=iar -DCMAKE_BUILD_TYPE=MinSizeRel
diff --git a/.github/workflows/cmake_arm.yml b/.github/workflows/cmake_arm.yml
index 6d7977de8..0ce63281e 100644
--- a/.github/workflows/cmake_arm.yml
+++ b/.github/workflows/cmake_arm.yml
@@ -75,7 +75,7 @@ jobs:
run: python3 tools/get_deps.py ${{ matrix.family }}
- name: Build
- run: python tools/build_cmake.py ${{ matrix.family }}
+ run: python tools/build_cmake.py ${{ matrix.family }} -DCMAKE_BUILD_TYPE=MinSizeRel
env:
# for rp2040, there is no harm if defined for other families
PICO_SDK_PATH: ${{ github.workspace }}/pico-sdk
diff --git a/hw/bsp/stm32f7/family.c b/hw/bsp/stm32f7/family.c
index 88cba2c7d..ce7e9d1bc 100644
--- a/hw/bsp/stm32f7/family.c
+++ b/hw/bsp/stm32f7/family.c
@@ -143,9 +143,19 @@ void board_init(void)
GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+// Suppress warning caused by mcu driver
+#ifdef __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow"
+#endif
+
/* Enable USB FS Clocks */
__HAL_RCC_USB_OTG_FS_CLK_ENABLE();
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
+
#if OTG_FS_VBUS_SENSE
/* Configure VBUS Pin */
GPIO_InitStruct.Pin = GPIO_PIN_9;
diff --git a/hw/bsp/stm32f7/family.mk b/hw/bsp/stm32f7/family.mk
index 4a699ea31..7f37a7e40 100644
--- a/hw/bsp/stm32f7/family.mk
+++ b/hw/bsp/stm32f7/family.mk
@@ -33,7 +33,7 @@ CFLAGS_GCC += \
-nostdlib -nostartfiles
# mcu driver cause following warnings
-CFLAGS_GCC += -Wno-error=shadow -Wno-error=cast-align
+CFLAGS_GCC += -Wno-error=cast-align
# -----------------
# Sources & Include
diff --git a/tools/build_cmake.py b/tools/build_cmake.py
index eb7375ae2..e539b9f94 100644
--- a/tools/build_cmake.py
+++ b/tools/build_cmake.py
@@ -13,8 +13,6 @@ SKIPPED = "\033[33mskipped\033[0m"
build_separator = '-' * 106
-toolchain_iar = '-DTOOLCHAIN=iar'
-
def filter_with_input(mylist):
if len(sys.argv) > 1:
input_args = list(set(mylist).intersection(sys.argv))
@@ -22,7 +20,7 @@ def filter_with_input(mylist):
mylist[:] = input_args
-def build_family(family, toolchain_option):
+def build_family(family, cmake_option):
all_boards = []
for entry in os.scandir("hw/bsp/{}/boards".format(family)):
if entry.is_dir() and entry.name != 'pico_sdk':
@@ -38,7 +36,7 @@ def build_family(family, toolchain_option):
# Generate build
r = subprocess.run(f"cmake examples -B {build_dir} -G \"Ninja\" -DFAMILY={family} -DBOARD"
- f"={board} {toolchain_option}", shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ f"={board} {cmake_option}", shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
# Build
if r.returncode == 0:
@@ -74,9 +72,10 @@ def build_family(family, toolchain_option):
if __name__ == '__main__':
- # IAR CC
- if toolchain_iar not in sys.argv:
- toolchain_iar = ''
+ cmake_options = ''
+ for a in sys.argv[1:]:
+ if a.startswith('-'):
+ cmake_options += ' ' + a
# If family are not specified in arguments, build all supported
all_families = []
@@ -93,7 +92,7 @@ if __name__ == '__main__':
# succeeded, failed, skipped
total_result = [0, 0, 0]
for family in all_families:
- fret = build_family(family, toolchain_iar)
+ fret = build_family(family, cmake_options)
if len(fret) == len(total_result):
total_result = [total_result[i] + fret[i] for i in range(len(fret))]