From fd2b8bab7131e54850c6f939deae97b183f12ef8 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Thu, 15 Jan 2026 15:40:38 -0800 Subject: [PATCH 1/2] CMakeLists.txt: Don't override CMAKE_C_FLAGS_RELEASE set by the user Resolves https://github.com/ebiggers/libdeflate/issues/408 --- CMakeLists.txt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 79f8badd..85366515 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,10 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build" FORCE) endif() +if(DEFINED CMAKE_C_FLAGS_RELEASE) + set(LIBDEFLATE_USER_SET_RELEASE_FLAGS ON) +endif() + # With MSVC, don't automatically append /W3 to the compiler flags. # This makes it possible for the user to select /W4. if(POLICY CMP0092) @@ -64,7 +68,10 @@ if(NOT LIBDEFLATE_BUILD_STATIC_LIB) endif() # Set common C compiler flags for all targets (the library and the programs). -set(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG") +if(NOT LIBDEFLATE_USER_SET_RELEASE_FLAGS) + set(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG" + CACHE STRING "C compiler flags for release builds" FORCE) +endif() set(CMAKE_C_STANDARD 99) if(NOT MSVC) check_c_compiler_flag(-Wdeclaration-after-statement HAVE_WDECLARATION_AFTER_STATEMENT) @@ -366,4 +373,4 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libdeflate-config.cmake # Build the programs subdirectory if needed. if(LIBDEFLATE_BUILD_GZIP OR LIBDEFLATE_BUILD_TESTS) add_subdirectory(programs) -endif() \ No newline at end of file +endif() From 17e1af09701e85b48cceebb6ce7448a998eb8b91 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Thu, 15 Jan 2026 15:46:56 -0800 Subject: [PATCH 2/2] cirrus.yml: upgrade to working FreeBSD image --- .cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 04143b68..8f0c1f0b 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,7 +1,7 @@ task: freebsd_instance: matrix: - - image_family: freebsd-14-2 + - image_family: freebsd-15-0-amd64-ufs install_script: pkg install -y cmake script: - cmake -B build -DLIBDEFLATE_BUILD_TESTS=1