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
91 changes: 50 additions & 41 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,66 @@
---
version: 7.11.0-{build}

image:
- Visual Studio 2022
- Visual Studio 2022

environment:
STUDIO_VERSION_EDITION: Studio\2022\Community
MSVC_FOLDER: C:\Program Files\Microsoft Visual %STUDIO_VERSION_EDITION%\VC
PLATFORM_TYPE:
CMAKE_CONFIG: Debug
TEST_TARGET: check
matrix:
- TARGET: cmake
CMAKE_OPTIONS: -DAO_BUILD_SHARED_LIBS=ON -Werror=deprecated
- TARGET: cmake
CFLAGS_EXTRA: -DAO_CMPXCHG16B_AVAILABLE
CMAKE_OPTIONS: -Denable_assertions=ON -Dinstall_headers=OFF
- TARGET: cmake
CMAKE_CONFIG: Release
CMAKE_OPTIONS: -DCMAKE_BUILD_TYPE=Release -Denable_gpl=OFF
- TARGET: cmake
CMAKE_OPTIONS: -A Win32 -Denable_assertions=ON -Denable_docs=OFF
- TARGET: cmake
CMAKE_CONFIG: Release
CMAKE_OPTIONS: -A ARM64 -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=MinSizeRel -DAO_BUILD_SHARED_LIBS=ON
- TARGET: nmake
ARCH: x86
CFLAGS_EXTRA: /J
- TARGET: nmake
ARCH: x86
CFLAGS_EXTRA: -DNDEBUG
- TARGET: nmake
ARCH: x64
CFLAGS_EXTRA: -DAO_CMPXCHG16B_AVAILABLE
- TARGET: nmake
ARCH: x86_x64
CFLAGS_EXTRA: -DNDEBUG
- TARGET: nmake
ARCH: x64_arm64
TEST_TARGET: check-deps
- TARGET: cmake
CMAKE_OPTIONS: -DAO_BUILD_SHARED_LIBS=ON -Werror=deprecated
- TARGET: cmake
CFLAGS_EXTRA: -DAO_CMPXCHG16B_AVAILABLE
CMAKE_OPTIONS: -Denable_assertions=ON -Dinstall_headers=OFF
- TARGET: cmake
CMAKE_CONFIG: Release
CMAKE_OPTIONS: -DCMAKE_BUILD_TYPE=Release -Denable_gpl=OFF
- TARGET: cmake
CMAKE_OPTIONS: -A Win32 -Denable_assertions=ON -Denable_docs=OFF
- TARGET: cmake
CMAKE_CONFIG: Release
CMAKE_OPTIONS: >-
-A ARM64 -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=MinSizeRel
-DAO_BUILD_SHARED_LIBS=ON
- TARGET: nmake
ARCH: x86
CFLAGS_EXTRA: /J
- TARGET: nmake
ARCH: x86
CFLAGS_EXTRA: -DNDEBUG
- TARGET: nmake
ARCH: x64
CFLAGS_EXTRA: -DAO_CMPXCHG16B_AVAILABLE
- TARGET: nmake
ARCH: x86_x64
CFLAGS_EXTRA: -DNDEBUG
- TARGET: nmake
ARCH: x64_arm64
TEST_TARGET: check-deps

clone_depth: 1

build_script:
- cmd: if [%TARGET%]==[cmake] (
mkdir out && cd out
&& cmake %CMAKE_OPTIONS% -Denable_werror=ON -DCFLAGS_EXTRA="%CFLAGS_EXTRA%" ..
&& cmake --build . --config %CMAKE_CONFIG% --verbose --parallel )
- cmd: if [%TARGET%]==[nmake] (
"C:\Program Files\Microsoft Visual %STUDIO_VERSION_EDITION%\VC\Auxiliary\Build\vcvarsall.bat" %ARCH% %PLATFORM_TYPE%
&& cd src && nmake -f Makefile.msft clean all CFLAGS_EXTRA="/WX %CFLAGS_EXTRA%" && cd .. )
- cmd: if [%TARGET%]==[cmake] (
mkdir out && cd out
&& cmake %CMAKE_OPTIONS% -Denable_werror=ON
-DCFLAGS_EXTRA="%CFLAGS_EXTRA%" ..
&& cmake --build . --config %CMAKE_CONFIG% --verbose --parallel )
- cmd: if [%TARGET%]==[nmake] (
"%MSVC_FOLDER%\Auxiliary\Build\vcvarsall.bat" %ARCH% %PLATFORM_TYPE%
&& cd src
&& nmake -f Makefile.msft clean all CFLAGS_EXTRA="/WX %CFLAGS_EXTRA%"
&& cd .. )

test_script:
- cmd: if [%TARGET%]==[cmake] (
ctest --build-config %CMAKE_CONFIG% --verbose --parallel 4 )
- cmd: if [%TARGET%]==[nmake] (
"C:\Program Files\Microsoft Visual %STUDIO_VERSION_EDITION%\VC\Auxiliary\Build\vcvarsall.bat" %ARCH% %PLATFORM_TYPE%
&& cd src && nmake -f Makefile.msft %TEST_TARGET% CFLAGS_EXTRA="/WX %CFLAGS_EXTRA%" )
- cmd: if [%TARGET%]==[cmake] (
ctest --build-config %CMAKE_CONFIG% --verbose --parallel 4 )
- cmd: if [%TARGET%]==[nmake] (
"%MSVC_FOLDER%\Auxiliary\Build\vcvarsall.bat" %ARCH% %PLATFORM_TYPE%
&& cd src
&& nmake -f Makefile.msft %TEST_TARGET%
CFLAGS_EXTRA="/WX %CFLAGS_EXTRA%" )
180 changes: 96 additions & 84 deletions .github/workflows/cmake-build.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
---
# This workflow is for CMake-based build/test running on multiple platforms.
name: cmake build

on: [push, pull_request]
"on": [push, pull_request]

jobs:
build:
name: ${{ matrix.os }} ${{ matrix.c_compiler }} ${{ matrix.build_type }} dll:${{ matrix.shared_libs }} assert:${{ matrix.assertions }} intrinsic:${{ matrix.atomic_intrinsics }}
name: >-
${{ matrix.os }} ${{ matrix.c_compiler }} ${{ matrix.build_type }}
dll:${{ matrix.shared_libs }} assert:${{ matrix.assertions }}
intrinsic:${{ matrix.atomic_intrinsics }}
runs-on: ${{ matrix.os }}
timeout-minutes: 3

Expand All @@ -14,93 +18,101 @@ jobs:
fail-fast: false

matrix:
os: [ macos-26-intel, macos-latest, ubuntu-24.04-arm, ubuntu-latest, windows-11-arm, windows-latest ]
c_compiler: [ cl, clang, gcc ]
build_type: [ Release, Debug ]
shared_libs: [ off, on ]
assertions: [ off, on ]
atomic_intrinsics: [ on, off ]
os:
- macos-26-intel
- macos-latest
- ubuntu-24.04-arm
- ubuntu-latest
- windows-11-arm
- windows-latest
c_compiler: [cl, clang, gcc]
build_type: [Release, Debug]
shared_libs: ["off", "on"]
assertions: ["off", "on"]
atomic_intrinsics: ["on", "off"]
exclude:
- c_compiler: gcc
os: macos-26-intel
- c_compiler: gcc
os: macos-latest
- c_compiler: cl
os: macos-26-intel
- c_compiler: cl
os: macos-latest
- c_compiler: cl
os: ubuntu-24.04-arm
- c_compiler: cl
os: ubuntu-latest
# The following ones are to reduce amount of jobs.
- assertions: off
build_type: Debug
- assertions: on
build_type: Release
- c_compiler: gcc
os: macos-26-intel
- c_compiler: gcc
os: macos-latest
- c_compiler: cl
os: macos-26-intel
- c_compiler: cl
os: macos-latest
- c_compiler: cl
os: ubuntu-24.04-arm
- c_compiler: cl
os: ubuntu-latest
# The following ones are to reduce amount of jobs.
- assertions: "off"
build_type: Debug
- assertions: "on"
build_type: Release
include:
- os: windows-11-arm
c_compiler: clang
cmake_generator_opt: '-G "Unix Makefiles"'
- os: windows-11-arm
c_compiler: gcc
cmake_generator_opt: '-G "Unix Makefiles"'
- os: windows-latest
c_compiler: clang
cmake_generator_opt: '-G "Unix Makefiles"'
- os: windows-latest
c_compiler: gcc
cmake_generator_opt: '-G "Unix Makefiles"'
# The following one are just to test some rare options.
- os: macos-latest
shared_libs: off
disable_docs_opt: '-Denable_docs=OFF'
- os: ubuntu-latest
assertions: on
c_compiler: gcc
shared_libs: on
no_install_headers: '-Dinstall_headers=OFF'
- os: windows-latest
assertions: off
c_compiler: clang
shared_libs: off
disable_gpl_opt: '-Denable_gpl=OFF'
- os: windows-11-arm
c_compiler: clang
cmake_generator_opt: '-G "Unix Makefiles"'
- os: windows-11-arm
c_compiler: gcc
cmake_generator_opt: '-G "Unix Makefiles"'
- os: windows-latest
c_compiler: clang
cmake_generator_opt: '-G "Unix Makefiles"'
- os: windows-latest
c_compiler: gcc
cmake_generator_opt: '-G "Unix Makefiles"'
# The following one are just to test some rare options.
- os: macos-latest
shared_libs: "off"
disable_docs_opt: '-Denable_docs=OFF'
- os: ubuntu-latest
assertions: "on"
c_compiler: gcc
shared_libs: "on"
no_install_headers: '-Dinstall_headers=OFF'
- os: windows-latest
assertions: "off"
c_compiler: clang
shared_libs: "off"
disable_gpl_opt: '-Denable_gpl=OFF'

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Set reusable strings
# Turn repeated input strings into step outputs.
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Set reusable strings
# Turn repeated input strings into step outputs.
id: strings
shell: bash
run: >
echo "build-output-dir=${{ github.workspace }}/build"
>> "$GITHUB_OUTPUT"

- name: Configure CMake
# Configure CMake in a 'build' subdirectory.
run: >
cmake --version &&
cmake -B ${{ steps.strings.outputs.build-output-dir }}
${{ matrix.cmake_generator_opt }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-Denable_werror=ON
-DAO_BUILD_SHARED_LIBS=${{ matrix.shared_libs }}
-Denable_assertions=${{ matrix.assertions }}
-Denable_atomic_intrinsics=${{ matrix.atomic_intrinsics }}
${{ matrix.disable_docs_opt }}
${{ matrix.disable_gpl_opt }}
${{ matrix.no_install_headers }}
-Werror=author
-S ${{ github.workspace }}
- name: Configure CMake
# Configure CMake in a 'build' subdirectory.
run: >
cmake --version &&
cmake -B ${{ steps.strings.outputs.build-output-dir }}
${{ matrix.cmake_generator_opt }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-Denable_werror=ON
-DAO_BUILD_SHARED_LIBS=${{ matrix.shared_libs }}
-Denable_assertions=${{ matrix.assertions }}
-Denable_atomic_intrinsics=${{ matrix.atomic_intrinsics }}
${{ matrix.disable_docs_opt }}
${{ matrix.disable_gpl_opt }}
${{ matrix.no_install_headers }}
-Werror=author
-S ${{ github.workspace }}

- name: Build
# Build the code with the given configuration.
run: >
cmake --build ${{ steps.strings.outputs.build-output-dir }}
--config ${{ matrix.build_type }} --verbose --parallel
- name: Build
# Build the code with the given configuration.
run: >
cmake --build ${{ steps.strings.outputs.build-output-dir }}
--config ${{ matrix.build_type }} --verbose --parallel

- name: Test
working-directory: ${{ steps.strings.outputs.build-output-dir }}
# Execute tests defined by the CMake configuration.
run: ctest --build-config ${{ matrix.build_type }} --verbose --parallel 4
- name: Test
working-directory: ${{ steps.strings.outputs.build-output-dir }}
# Execute tests defined by the CMake configuration.
run: >
ctest --build-config ${{ matrix.build_type }} --verbose --parallel 4
38 changes: 38 additions & 0 deletions .github/workflows/cppcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
# This workflow is to check C source with cppcheck.
name: cppcheck

"on": [push, pull_request]

jobs:
check:
name: ${{ matrix.name }}
runs-on: ubuntu-24.04-arm

strategy:
# Deliver the feedback for all matrix combinations.
fail-fast: false

matrix:
include:
- name: Check unused
args: --enable=unusedFunction -D AO_TEST_EMULATION
- name: All checks (other)
args: >-
-j4 --enable=information,performance,portability,style,warning
--suppress=missingIncludeSystem --suppress=unmatchedSuppression

steps:
- uses: actions/checkout@v6

- name: Install cppcheck (Ubuntu)
uses: awalsh128/cache-apt-pkgs-action@v1
with:
packages: cppcheck
version: 1.0

- name: Run cppcheck analysis
run: >-
cppcheck --force --error-exitcode=2 --quiet -D CPPCHECK -U AO_API
-U HAVE_CONFIG_H -I src --check-level=exhaustive --safety
${{ matrix.args }} `find . -iname '*.c'`
32 changes: 32 additions & 0 deletions .github/workflows/csa-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
# This workflow is to check C/C++ source with Clang Static Analyzer (CSA).
name: csa check

"on": [push, pull_request]

jobs:
check:
name: ${{ matrix.os }} ${{ matrix.cflags_extra }}
runs-on: ${{ matrix.os }}

strategy:
# Deliver the feedback for all matrix combinations.
fail-fast: false

matrix:
include:
- os: macos-latest
cflags_extra: -m32
- os: ubuntu-latest
cflags_extra: -D AO_TRACE_MALLOC -D HAVE_MMAP -D VERBOSE_STACK

steps:
- uses: actions/checkout@v6

- name: Check C/C++ files by CSA
run: >
set -o pipefail;
clang --analyze -Xanalyzer -analyzer-output=text -Werror -I src
${{ matrix.cflags_extra }} `find . -iname '*.c'` 2>&1
| tee clang-analyzer-output.log;
if [ -s clang-analyzer-output.log ]; then exit 1; fi
Loading
Loading