diff options
| author | hathach <[email protected]> | 2026-03-05 23:24:14 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2026-03-05 23:24:14 +0700 |
| commit | 61e4b9ce3fba2fea731396c56eee1c7b5a2f5338 (patch) | |
| tree | 8a9e326a544a34f7a0999a8c5b11bee4307314e2 /hw | |
| parent | 97476872aa841fcd9cd622e4082d6c57b183c67f (diff) | |
add IAR warning flags to cmake build and fix them
Diffstat (limited to 'hw')
| -rw-r--r-- | hw/bsp/family_support.cmake | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/hw/bsp/family_support.cmake b/hw/bsp/family_support.cmake index 4299ad44e..c166a0618 100644 --- a/hw/bsp/family_support.cmake +++ b/hw/bsp/family_support.cmake @@ -105,6 +105,12 @@ set(WARN_FLAGS_GNU ) set(WARN_FLAGS_Clang ${WARN_FLAGS_GNU}) +set(WARN_FLAGS_IAR + --warnings_are_errors + --diag_suppress=Pa089 + --diag_suppress=Pe236 + ) + # Optimization if (NOT DEFINED CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "") set(CMAKE_BUILD_TYPE MinSizeRel CACHE STRING "Build type" FORCE) @@ -467,6 +473,7 @@ function(family_configure_common TARGET RTOS) target_link_options(${TARGET} PUBLIC "LINKER:--no-warn-rwx-segments") endif () elseif (CMAKE_C_COMPILER_ID STREQUAL "IAR") + target_compile_options(${TARGET} PRIVATE $<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:${WARN_FLAGS_IAR}>) target_link_options(${TARGET} PUBLIC "LINKER:--map=$<TARGET_FILE:${TARGET}>.map") if (IAR_CSTAT) |
