Skip to content

Commit

Permalink
Enable CI options explicitly so forked repositories don't fail CI. ma…
Browse files Browse the repository at this point in the history
  • Loading branch information
nmoinvaz authored and Dead2 committed Feb 7, 2020
1 parent 98666ba commit fac3338
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ jobs:
run: |
mkdir ${{ matrix.build-dir || '.not-used' }}
cd ${{ matrix.build-dir || '.' }}
${{ matrix.cmake-prefix }} cmake ${{ matrix.build-src-dir || '.' }} ${{ matrix.cmake-args }} -DCMAKE_BUILD_TYPE=${{ matrix.build-config || 'Release' }} -DBUILD_SHARED_LIBS=OFF -DWITH_GZFILEOP=ON
${{ matrix.cmake-prefix }} cmake ${{ matrix.build-src-dir || '.' }} ${{ matrix.cmake-args }} -DCMAKE_BUILD_TYPE=${{ matrix.build-config || 'Release' }} -DBUILD_SHARED_LIBS=OFF -DWITH_GZFILEOP=ON -DWITH_FUZZERS=ON -DWITH_CODE_COVERAGE=ON -DWITH_MAINTAINER_WARNINGS=ON
env:
CC: ${{ matrix.compiler }}
CFLAGS: ${{ matrix.cflags }}
Expand Down
19 changes: 6 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,8 @@ elseif(BASEARCH_S360_FOUND AND "${ARCH}" MATCHES "s390x")
option(WITH_DFLTCC_DEFLATE "Use DEFLATE CONVERSION CALL instruction for compression on IBM Z" OFF)
option(WITH_DFLTCC_INFLATE "Use DEFLATE CONVERSION CALL instruction for decompression on IBM Z" OFF)
endif()
option(MAINTAINER "Build with extra warnings and tests enabled" OFF)

if(DEFINED ENV{CI})
message(STATUS "CI detected, enabling maintainer mode.")
set(MAINTAINER ON)
set(CODECOVERAGE ON)
endif()
if(MAINTAINER)
set(WITH_FUZZERS ON)
endif()
option(WITH_MAINTAINER_WARNINGS "Build with project maintainer warnings" OFF)
option(WITH_CODE_COVERAGE "Enable code coverage reporting" OFF)

add_feature_info(ZLIB_COMPAT ZLIB_COMPAT "Provide a zlib-compatible API")
add_feature_info(WITH_GZFILEOP WITH_GZFILEOP "Compile with support for gzFile-related functions")
Expand All @@ -117,7 +109,8 @@ if(BASEARCH_ARM_FOUND)
add_feature_info(WITH_ACLE WITH_ACLE "Build with ACLE CRC")
add_feature_info(WITH_NEON WITH_NEON "Build with NEON intrinsics")
endif()
add_feature_info(MAINTAINER MAINTAINER "Build with maintainer warnings and tests enabled")
add_feature_info(WITH_MAINTAINER_WARNINGS WITH_MAINTAINER_WARNINGS "Build with project maintainer warnings")
add_feature_info(WITH_CODE_COVERAGE WITH_CODE_COVERAGE "Enable code coverage reporting")

if (ZLIB_COMPAT)
add_definitions(-DZLIB_COMPAT)
Expand Down Expand Up @@ -254,12 +247,12 @@ if(UNALIGNED_OK)
endif()

# Apply warning flags to cflags
if(MAINTAINER)
if(WITH_MAINTAINER_WARNINGS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNFLAGS} ${WARNFLAGS_MAINTAINER} ${WARNFLAGS_DISABLE}")
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNFLAGS} ${WARNFLAGS_DISABLE}")
endif()
if(CODECOVERAGE)
if(WITH_CODE_COVERAGE)
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -g -coverage")
elseif(__GNUC__)
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ Build Options
| WITH_DFLTCC_INFLATE | --with-dfltcc-inflate | Use DEFLATE COMPRESSION CALL instruction for decompression on IBM Z | OFF |
| WITH_SANITIZERS | --with-sanitizers | Build with address sanitizer and all supported sanitizers other than memory sanitizer | OFF |
| WITH_FUZZERS | --with-fuzzers | Build test/fuzz | OFF |
| WITH_MAINTAINER_WARNINGS | | Build with project maintainer warnings | OFF |
| WITH_CODE_COVERAGE | | Enable code coverage reporting | OFF |

Install
-------
Expand Down

0 comments on commit fac3338

Please sign in to comment.