Skip to content

Commit

Permalink
Release v0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
arobenko committed Sep 28, 2024
2 parents 67bd306 + b651843 commit 75f0b30
Show file tree
Hide file tree
Showing 6 changed files with 159 additions and 18 deletions.
130 changes: 126 additions & 4 deletions .github/workflows/actions_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: Github Actions Build
on: [push]

env:
COMMS_TAG: v5.2.3
CC_TOOLS_QT_TAG: v5.3
CC_MQTT5_GENERATED_TAG: v2.7
CC_MQTT5_LIBS_TAG: v0.5
COMMS_TAG: v5.2.7
CC_TOOLS_QT_TAG: v5.3.3
CC_MQTT5_GENERATED_TAG: v2.9
CC_MQTT5_LIBS_TAG: v1.0.1

jobs:

Expand Down Expand Up @@ -66,6 +66,66 @@ jobs:
run: cmake --build . --config ${{matrix.type}} --target install
env:
VERBOSE: 1

build_gcc_ubuntu_24_04:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
type: [Debug, Release, MinSizeRel]
cc_ver: [13, 14]
cpp: [17, 20, 23]
qt_ver: [5, 6]
exclude:
- cc_ver: 13
cpp: 23

steps:
- uses: actions/checkout@v4

- name: Prepare Install
run: sudo apt-get update --fix-missing

- name: Install Packages
run: sudo apt install qtbase5-dev qt6-base-dev libqt${{matrix.qt_ver}}serialport${{matrix.qt_ver}}-dev gcc-${{matrix.cc_ver}} g++-${{matrix.cc_ver}}

- name: Create Build Environment
run: cmake -E make_directory ${{runner.workspace}}/build

- name: Prepare externals
shell: bash
run: $GITHUB_WORKSPACE/script/prepare_externals.sh
env:
BUILD_DIR: ${{runner.workspace}}/build
CC: gcc-${{matrix.cc_ver}}
CXX: g++-${{matrix.cc_ver}}
EXTERNALS_DIR: ${{runner.workspace}}/externals
COMMON_INSTALL_DIR: ${{runner.workspace}}/build/install
COMMON_BUILD_TYPE: ${{matrix.type}}
COMMON_CXX_STANDARD: ${{matrix.cpp}}
COMMON_QT_VER: ${{matrix.qt_ver}}
COMMS_TAG: ${{env.COMMS_TAG}}
CC_TOOLS_QT_TAG: ${{env.CC_TOOLS_QT_TAG}}
CC_MQTT5_GENERATED_TAG: ${{env.CC_MQTT5_GENERATED_TAG}}
CC_MQTT5_LIBS_TAG: ${{env.CC_MQTT5_LIBS_TAG}}

- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/build
run: |
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{matrix.type}} -DCMAKE_INSTALL_PREFIX=install \
-DCMAKE_PREFIX_PATH=${{runner.workspace}}/build/install -DCMAKE_CXX_STANDARD=${{matrix.cpp}} \
-DOPT_QT_MAJOR_VERSION=${{matrix.qt_ver}}
env:
CC: gcc-${{matrix.cc_ver}}
CXX: g++-${{matrix.cc_ver}}

- name: Build Target
working-directory: ${{runner.workspace}}/build
shell: bash
run: cmake --build . --config ${{matrix.type}} --target install
env:
VERBOSE: 1

build_clang_ubuntu_22_04:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -133,6 +193,68 @@ jobs:
env:
VERBOSE: 1

build_clang_ubuntu_24_04:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
type: [Debug, Release, MinSizeRel]
cc_ver: [16, 17, 18]
cpp: [17, 20, 23]
qt_ver: [5, 6]
exclude:
- cc_ver: 16
cpp: 23
- cc_ver: 17
cpp: 23

steps:
- uses: actions/checkout@v4

- name: Prepare Install
run: sudo apt-get update --fix-missing

- name: Install Packages
run: sudo apt install qtbase5-dev qt6-base-dev libqt${{matrix.qt_ver}}serialport${{matrix.qt_ver}}-dev clang-${{matrix.cc_ver}}

- name: Create Build Environment
run: cmake -E make_directory ${{runner.workspace}}/build

- name: Prepare externals
shell: bash
run: $GITHUB_WORKSPACE/script/prepare_externals.sh
env:
BUILD_DIR: ${{runner.workspace}}/build
CC: clang-${{matrix.cc_ver}}
CXX: clang++-${{matrix.cc_ver}}
EXTERNALS_DIR: ${{runner.workspace}}/externals
COMMON_INSTALL_DIR: ${{runner.workspace}}/build/install
COMMON_BUILD_TYPE: ${{matrix.type}}
COMMON_CXX_STANDARD: ${{matrix.cpp}}
COMMON_QT_VER: ${{matrix.qt_ver}}
COMMS_TAG: ${{env.COMMS_TAG}}
CC_TOOLS_QT_TAG: ${{env.CC_TOOLS_QT_TAG}}
CC_MQTT5_GENERATED_TAG: ${{env.CC_MQTT5_GENERATED_TAG}}
CC_MQTT5_LIBS_TAG: ${{env.CC_MQTT5_LIBS_TAG}}

- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/build
run: |
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{matrix.type}} -DCMAKE_INSTALL_PREFIX=install \
-DCMAKE_PREFIX_PATH=${{runner.workspace}}/build/install -DCMAKE_CXX_STANDARD=${{matrix.cpp}} \
-DOPT_QT_MAJOR_VERSION=${{matrix.qt_ver}}
env:
CC: clang-${{matrix.cc_ver}}
CXX: clang++-${{matrix.cc_ver}}

- name: Build Target
working-directory: ${{runner.workspace}}/build
shell: bash
run: cmake --build . --config ${{matrix.type}} --target install
env:
VERBOSE: 1

build_msvc_2019:
runs-on: windows-2019
strategy:
Expand Down
22 changes: 15 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ project ("cc_tools_plugin_mqtt5_client_filter")

# Available options
option (OPT_WARN_AS_ERR "Treat warning as error" ON)
option (OPT_USE_CCACHE "Use ccache on UNIX systems if it's available" OFF)
option (OPT_USE_CCACHE "Use ccache if it's available" OFF)
option (OPT_WITH_DEFAULT_SANITIZERS "Build with sanitizers" OFF)

# Extra configuration variables
# OPT_QT_MAJOR_VERSION - Major Qt version. Defaults to 5
# OPT_CCACHE_EXECUTABLE - Custom ccache executable

# Extra standard CMake configuration
# CMAKE_CXX_STANDARD - C++ standard to use, defaults (and min required) to 17
Expand All @@ -33,18 +35,24 @@ endif()
#######################################################################

# Compiler options
set (compile_opts)
set (extra_opts)
if (OPT_WARN_AS_ERR)
list (APPEND compile_opts WARN_AS_ERR)
list (APPEND extra_opts WARN_AS_ERR)
endif ()

set (ccache_opt)
if ((UNIX) AND (OPT_USE_CCACHE))
list (APPEND compile_opts USE_CCACHE)
if (OPT_USE_CCACHE)
list (APPEND extra_opts USE_CCACHE)
if (NOT "${OPT_CCACHE_EXECUTABLE}" STREQUAL "")
list(APPEND extra_opts CCACHE_EXECUTABLE "${OPT_CCACHE_EXECUTABLE}")
endif()
endif ()

if (OPT_WITH_DEFAULT_SANITIZERS)
list(APPEND extra_opts DEFAULT_SANITIZERS)
endif()

include (${LibComms_DIR}/CC_Compile.cmake)
cc_compile(${compile_opts})
cc_compile(${extra_opts})
cc_msvc_force_warn_opt("/W4")

#######################################################################
Expand Down
3 changes: 2 additions & 1 deletion script/full_debug_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ ${SCRIPT_DIR}/prepare_externals.sh

cd ${BUILD_DIR}
cmake .. -DCMAKE_INSTALL_PREFIX=${COMMON_INSTALL_DIR} \
-DCMAKE_BUILD_TYPE=${COMMON_BUILD_TYPE} -DOPT_USE_CCACHE=ON -DOPT_QT_MAJOR_VERSION=${COMMON_QT_VER} "$@"
-DCMAKE_BUILD_TYPE=${COMMON_BUILD_TYPE} -DOPT_USE_CCACHE=ON \
-DOPT_QT_MAJOR_VERSION=${COMMON_QT_VER} "$@"

procs=$(nproc)
if [ -n "${procs}" ]; then
Expand Down
9 changes: 7 additions & 2 deletions script/full_debug_build_clang.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#!/bin/bash

export CC=clang
export CXX=clang++
if [ -z "${CC}" ]; then
export CC=clang
fi

if [ -z "${CXX}" ]; then
export CXX=clang++
fi

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
${SCRIPT_DIR}/full_debug_build.sh "$@"
Expand Down
9 changes: 7 additions & 2 deletions script/full_debug_build_gcc.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#!/bin/bash

export CC=gcc
export CXX=g++
if [ -z "${CC}" ]; then
export CC=gcc
fi

if [ -z "${CXX}" ]; then
export CXX=g++
fi

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
${SCRIPT_DIR}/full_debug_build.sh "$@"
Expand Down
4 changes: 2 additions & 2 deletions src/Mqtt5ClientFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
#include <memory>
#include <string>

static_assert(CC_MQTT5_CLIENT_MAKE_VERSION(0, 5, 0) <= CC_MQTT5_CLIENT_VERSION, "The version of the cc_mqtt5_client library is too old");
static_assert(CC_TOOLS_QT_MAKE_VERSION(5, 3, 0) <= CC_TOOLS_QT_VERSION, "The version of the cc_tools_qt library is too old");
static_assert(CC_MQTT5_CLIENT_MAKE_VERSION(1, 0, 1) <= CC_MQTT5_CLIENT_VERSION, "The version of the cc_mqtt5_client library is too old");
static_assert(CC_TOOLS_QT_MAKE_VERSION(5, 3, 3) <= CC_TOOLS_QT_VERSION, "The version of the cc_tools_qt library is too old");

namespace cc_plugin_mqtt5_client_filter
{
Expand Down

0 comments on commit 75f0b30

Please sign in to comment.