Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix gcc config warnings #36

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 4 additions & 16 deletions utilities/cmake/firmware/firmware.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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> Type can be Main or Initial")
endif()
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand All @@ -160,10 +145,13 @@ target_include_directories(${EXECUTABLE} PRIVATE
$<$<BOOL:UNIT_TESTS_SWITCH>:${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
$<$<CONFIG:Debug>:-g3>
$<$<CONFIG:Release>:-Werror>
Expand Down
7 changes: 0 additions & 7 deletions utilities/cmake/simulator/simulator.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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> Type can be Main or Initial")
endif()
Expand Down Expand Up @@ -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
Expand Down