0003-CMakeLists.txt-add-BUILD_WERROR-option.patch 1005 B

123456789101112131415161718192021222324252627282930
  1. From c0f2260d8b7e435bce765e7ac91d51f1b349b87b Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Sun, 10 Mar 2024 13:43:12 +0100
  4. Subject: [PATCH] CMakeLists.txt: add BUILD_WERROR option
  5. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  6. Upstream: https://github.com/zhaojh329/libuhttpd/commit/c0f2260d8b7e435bce765e7ac91d51f1b349b87b
  7. ---
  8. CMakeLists.txt | 8 +++++++-
  9. 1 file changed, 7 insertions(+), 1 deletion(-)
  10. diff --git a/CMakeLists.txt b/CMakeLists.txt
  11. index 6fb9651..6719e5f 100644
  12. --- a/CMakeLists.txt
  13. +++ b/CMakeLists.txt
  14. @@ -7,7 +7,13 @@ include(CheckLibraryExists)
  15. list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules/")
  16. add_definitions(-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64)
  17. -add_compile_options(-O -Wall -Werror --std=gnu99)
  18. +add_compile_options(-O -Wall --std=gnu99)
  19. +
  20. +option(BUILD_WERROR "Build with -Werror" ON)
  21. +
  22. +if(BUILD_WERROR)
  23. + add_compile_options(-Werror)
  24. +endif()
  25. option(BUILD_STATIC "Build static library" OFF)