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 <[email protected]>
This commit is contained in:
Ronald Cron
2025-07-21 11:57:55 +02:00
parent b5fd7b9a54
commit 2fc0475dc9
@@ -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)