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 <ronald.cron@arm.com>
This commit is contained in:
Ronald Cron
2025-06-20 09:19:20 +02:00
parent b5fd7b9a54
commit 2fc0475dc9

View File

@@ -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)