From 2fc0475dc9951892a78285bf562f9508b366f741 Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Fri, 20 Jun 2025 09:19:20 +0200 Subject: [PATCH] cmake_package_install: Fail in case of warnings with GNU GCC Fail the cmake package install demonstration in case of warnings when building the cmake_package_install executable. This would have caught the library installation issue reported in #10022. Signed-off-by: Ronald Cron --- programs/test/cmake_package_install/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/programs/test/cmake_package_install/CMakeLists.txt b/programs/test/cmake_package_install/CMakeLists.txt index 0d7dbe4dad..60a4481e48 100644 --- a/programs/test/cmake_package_install/CMakeLists.txt +++ b/programs/test/cmake_package_install/CMakeLists.txt @@ -37,5 +37,11 @@ find_package(MbedTLS REQUIRED) # add_executable(cmake_package_install cmake_package_install.c) + +string(REGEX MATCH "GNU" CMAKE_COMPILER_IS_GNU "${CMAKE_C_COMPILER_ID}") +if(CMAKE_COMPILER_IS_GNU) + target_compile_options(cmake_package_install PRIVATE -Wall -Werror) +endif() + target_link_libraries(cmake_package_install MbedTLS::mbedtls MbedTLS::mbedx509 MbedTLS::tfpsacrypto)