diff --git a/package/libuhttpd/0003-CMakeLists.txt-add-BUILD_WERROR-option.patch b/package/libuhttpd/0003-CMakeLists.txt-add-BUILD_WERROR-option.patch new file mode 100644 index 0000000000..2e87014e87 --- /dev/null +++ b/package/libuhttpd/0003-CMakeLists.txt-add-BUILD_WERROR-option.patch @@ -0,0 +1,30 @@ +From c0f2260d8b7e435bce765e7ac91d51f1b349b87b Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Sun, 10 Mar 2024 13:43:12 +0100 +Subject: [PATCH] CMakeLists.txt: add BUILD_WERROR option + +Signed-off-by: Fabrice Fontaine +Upstream: https://github.com/zhaojh329/libuhttpd/commit/c0f2260d8b7e435bce765e7ac91d51f1b349b87b +--- + CMakeLists.txt | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6fb9651..6719e5f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -7,7 +7,13 @@ include(CheckLibraryExists) + list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules/") + + add_definitions(-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64) +-add_compile_options(-O -Wall -Werror --std=gnu99) ++add_compile_options(-O -Wall --std=gnu99) ++ ++option(BUILD_WERROR "Build with -Werror" ON) ++ ++if(BUILD_WERROR) ++ add_compile_options(-Werror) ++endif() + + option(BUILD_STATIC "Build static library" OFF) + diff --git a/package/libuhttpd/libuhttpd.mk b/package/libuhttpd/libuhttpd.mk index 0d5306c6dd..78e0f42b22 100644 --- a/package/libuhttpd/libuhttpd.mk +++ b/package/libuhttpd/libuhttpd.mk @@ -10,6 +10,7 @@ LIBUHTTPD_LICENSE = MIT LIBUHTTPD_LICENSE_FILES = LICENSE LIBUHTTPD_INSTALL_STAGING = YES LIBUHTTPD_DEPENDENCIES = libev +LIBUHTTPD_CONF_OPTS = -DBUILD_WERROR=OFF ifeq ($(BR2_PACKAGE_OPENSSL),y) LIBUHTTPD_DEPENDENCIES += openssl