From 1c3e466b1a04aadb16af97c8a42ab97fa90b4f56 Mon Sep 17 00:00:00 2001 From: Ujjwal Kumar Date: Fri, 30 Sep 2022 13:42:35 +0530 Subject: [PATCH 1/2] refactor (build): Enable necessary compiler warnings --- utilities/cmake/firmware/firmware.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utilities/cmake/firmware/firmware.cmake b/utilities/cmake/firmware/firmware.cmake index 8ad260f41..84849e331 100644 --- a/utilities/cmake/firmware/firmware.cmake +++ b/utilities/cmake/firmware/firmware.cmake @@ -160,10 +160,13 @@ target_include_directories(${EXECUTABLE} PRIVATE $<$:${PROJECT_SOURCE_DIR}/tests/apps/manager_app> ) +# warning flags ref: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html target_compile_options(${EXECUTABLE} PRIVATE -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -fdata-sections -ffunction-sections - -Wall -Wno-format-truncation -Wno-unused-but-set-variable -Wno-return-type + -Wall -Wextra -Wdouble-promotion -Wformat=2 -Wformat-security -Wformat-nonliteral + -Wformat-overflow=2 -Wmissing-include-dirs -Wnull-dereference -Wswitch-default + -Wswitch-enum -Wunused-const-variable=2 -Wuninitialized -Wstrict-overflow=4 -D_POSIX_C_SOURCE=200809L $<$:-g3> $<$:-Werror> From 8043b328e593a435a026b29e7b43a6b8e321e23a Mon Sep 17 00:00:00 2001 From: Ujjwal Kumar Date: Fri, 30 Sep 2022 13:41:58 +0530 Subject: [PATCH 2/2] fix (build): Remove deleted directory from includes --- utilities/cmake/firmware/firmware.cmake | 15 --------------- utilities/cmake/simulator/simulator.cmake | 7 ------- 2 files changed, 22 deletions(-) diff --git a/utilities/cmake/firmware/firmware.cmake b/utilities/cmake/firmware/firmware.cmake index 84849e331..f4d7552fc 100644 --- a/utilities/cmake/firmware/firmware.cmake +++ b/utilities/cmake/firmware/firmware.cmake @@ -28,14 +28,8 @@ ENDIF(DEV_SWITCH) if ("${FIRMWARE_TYPE}" STREQUAL "Main") add_compile_definitions(X1WALLET_INITIAL=0 X1WALLET_MAIN=1) - target_include_directories(${EXECUTABLE} PRIVATE - main/config/ - ) elseif("${FIRMWARE_TYPE}" STREQUAL "Initial") add_compile_definitions(X1WALLET_INITIAL=1 X1WALLET_MAIN=0) - target_include_directories(${EXECUTABLE} PRIVATE - initial/config/ - ) else() message(FATAL_ERROR "Firmware type not specified. Specify using -DFIRMWARE_TYPE= Type can be Main or Initial") endif() @@ -100,7 +94,6 @@ target_include_directories(${EXECUTABLE} PRIVATE common common/lvgl - common/lvgl/porting common/lvgl/src common/lvgl/src/lv_core common/lvgl/src/lv_draw @@ -121,21 +114,13 @@ target_include_directories(${EXECUTABLE} PRIVATE stm32-hal/Drivers/STM32L4xx_HAL_Driver/Inc/Legacy stm32-hal/Drivers/STM32L4xx_HAL_Driver/Src - stm32-hal/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc - stm32-hal/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src - stm32-hal/Middlewares/ST/STM32_USB_Device_Library/Core/Inc - stm32-hal/Middlewares/ST/STM32_USB_Device_Library/Core/Src - stm32-hal/Peripherals stm32-hal/Peripherals/Buzzer stm32-hal/Peripherals/display stm32-hal/Peripherals/display/SSD1306 - stm32-hal/Peripherals/flash/ - stm32-hal/Peripherals/logger/ stm32-hal/Peripherals/nfc/ stm32-hal/Src - stm32-hal/Startup stm32-hal/porting stm32-hal/Inc diff --git a/utilities/cmake/simulator/simulator.cmake b/utilities/cmake/simulator/simulator.cmake index 03ae71a6a..1be88010f 100644 --- a/utilities/cmake/simulator/simulator.cmake +++ b/utilities/cmake/simulator/simulator.cmake @@ -24,14 +24,8 @@ add_executable(${EXECUTABLE} ${SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/version.c ${ if ("${FIRMWARE_TYPE}" STREQUAL "Main") add_compile_definitions(X1WALLET_INITIAL=0 X1WALLET_MAIN=1) - target_include_directories(${PROJECT_NAME} PRIVATE - main/config/ - ) elseif("${FIRMWARE_TYPE}" STREQUAL "Initial") add_compile_definitions(X1WALLET_INITIAL=1 X1WALLET_MAIN=0) - target_include_directories(${PROJECT_NAME} PRIVATE - initial/config/ - ) else() message(FATAL_ERROR "Firmware type not specified. Specify using -DFIRMWARE_TYPE= Type can be Main or Initial") endif() @@ -96,7 +90,6 @@ target_include_directories(${PROJECT_NAME} PRIVATE common common/lvgl - common/lvgl/porting common/lvgl/src common/lvgl/src/lv_core common/lvgl/src/lv_draw