Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
11 changes: 9 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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()
endif()