Skip to content

Commit

Permalink
Merge pull request #6187 from daverodgman/backport-iar-fatal-warnings
Browse files Browse the repository at this point in the history
Backport 2.28: cmake: IAR support option( MBEDTLS_FATAL_WARNINGS)
  • Loading branch information
daverodgman authored Aug 9, 2022
2 parents 2c08ac7 + a37f5c1 commit 3469f7a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ if(CMAKE_COMPILER_IS_CLANG)
endif(CMAKE_COMPILER_IS_CLANG)

if(CMAKE_COMPILER_IS_IAR)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --warn_about_c_style_casts --warnings_are_errors -Ohz")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --warn_about_c_style_casts -Ohz")
endif(CMAKE_COMPILER_IS_IAR)

if(CMAKE_COMPILER_IS_MSVC)
Expand All @@ -243,6 +243,10 @@ if(MBEDTLS_FATAL_WARNINGS)
set(CMAKE_C_FLAGS_ASANDBG "${CMAKE_C_FLAGS_ASANDBG} -Wno-error=cpp")
endif(UNSAFE_BUILD)
endif(CMAKE_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNU)

if (CMAKE_COMPILER_IS_IAR)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --warning_are_errors")
endif(CMAKE_COMPILER_IS_IAR)
endif(MBEDTLS_FATAL_WARNINGS)

if(CMAKE_BUILD_TYPE STREQUAL "Coverage")
Expand Down
3 changes: 3 additions & 0 deletions ChangeLog.d/fix_cmake_using_iar_toolchain.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Bugfix
* Fixed an issue that cause compile error using CMake IAR toolchain.
Fixes #5964.

0 comments on commit 3469f7a

Please sign in to comment.