diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index 5f7b14c..0000000 --- a/.appveyor.yml +++ /dev/null @@ -1,71 +0,0 @@ -image: - - Visual Studio 2022 - - Visual Studio 2019 - - -init: - - git config --global core.autocrlf input - -clone_folder: c:\projects\cc.mqtt5.commsdsl -shallow_clone: true - -platform: - - x64 - - x86 - -configuration: - - Debug - - Release - -environment: - COMMS_TAG: v5.2.3 - COMMSDSL_TAG: v6.3.2 - CC_TOOLS_QT_TAG: v5.2.1 - matrix: - - CPP_STD: 11 - QT_MAJOR: 5 - EXTRA_CONFIG: -DMQTT5_BUILD_TOOLS=OFF - - CPP_STD: 14 - QT_MAJOR: 5 - EXTRA_CONFIG: -DMQTT5_BUILD_TOOLS=OFF - - CPP_STD: 17 - QT_MAJOR: 5 - - CPP_STD: 20 - QT_MAJOR: 5 - - CPP_STD: 20 - QT_MAJOR: 6 - -matrix: - fast_finish: false - exclude: - - platform: x86 - QT_MAJOR: 6 - -install: - - call script\appveyor_install.bat - - set PATH=%PATH%;%QTDIR%\bin - - set BUILD_DIR=%APPVEYOR_BUILD_FOLDER%\build.%PLATFORM%.%CONFIGURATION%.%TOOLCHAIN% - - if exist %BUILD_DIR% rmdir /S /Q %BUILD_DIR% - - set COMMS_TAG=%COMMS_TAG% - - set COMMSDSL_TAG=%COMMSDSL_TAG% - - set CC_TOOLS_QT_TAG=%CC_TOOLS_QT_TAG% - - set COMMON_INSTALL_DIR=%BUILD_DIR%\install - - set COMMON_BUILD_TYPE=%CONFIGURATION% - - set COMMON_CXX_STANDARD=%CPP_STD% - - set GENERATOR="%CMAKE_GENERATOR%" - - set PLATFORM="%CMAKE_PLATFORM%" - - set CC_TOOLS_QT_MAJOR_QT_VERSION=%QT_MAJOR% - - call script\prepare_externals.bat - -build_script: - - echo ------------------------- Building Project ------------------------- - - cd %BUILD_DIR% - - cmake .. -DCMAKE_BUILD_TYPE=%CONFIGURATION% -G "%CMAKE_GENERATOR%" %PLATFORM_PARAM% ^ - -DBOOST_ROOT="%BOOST_DIR%" -DBoost_USE_STATIC_LIBS=ON -DCMAKE_INSTALL_PREFIX="%COMMON_INSTALL_DIR%" ^ - -DCMAKE_PREFIX_PATH="%COMMON_INSTALL_DIR%" -DCMAKE_CXX_STANDARD=%CPP_STD% ^ - -DMQTT5_GEN_PROTOCOL=ON -DMQTT5_GEN_TEST=ON -DMQTT5_GEN_TOOLS=ON -DMQTT5_TOOLS_QT_VER=%QT_MAJOR% ^ - %EXTRA_CONFIG% - - cmake --build . --config %CONFIGURATION% --parallel %NUMBER_OF_PROCESSORS% - - - diff --git a/.github/workflows/actions_build.yml b/.github/workflows/actions_build.yml index 3b6b5c3..9ba0c06 100644 --- a/.github/workflows/actions_build.yml +++ b/.github/workflows/actions_build.yml @@ -3,9 +3,9 @@ name: Github Actions Build on: [push] env: - COMMS_TAG: v5.2.3 - COMMSDSL_TAG: v6.3.2 - CC_TOOLS_QT_TAG: v5.2.1 + COMMS_TAG: v5.2.5 + COMMSDSL_TAG: v6.3.3 + CC_TOOLS_QT_TAG: v5.3.1 jobs: build_gcc_old_ubuntu_20_04: diff --git a/CMakeLists.txt b/CMakeLists.txt index ffe19d2..1c5c001 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 3.10) project ("cc.mqtt5.commsdsl") option (MQTT5_WARN_AS_ERR "Treat compilation warnings as errors." ON) -option (MQTT5_USE_CCACHE "Use ccache on UNIX." ON) +option (MQTT5_USE_CCACHE "Use ccache." OFF) option (MQTT5_GEN_PROTOCOL "Use commsdsl2comms to generate protocol definition" ON) option (MQTT5_BUILD_PROTOCOL "Build and install protocol definition generated by the commsdsl2comms" ${MQTT5_GEN_PROTOCOL}) option (MQTT5_BUILD_PROT_DOC "Build documentation for generated protocol" OFF) @@ -25,14 +25,15 @@ option (MQTT5_BUILD_EMSCRIPTEN "Build and install project generated by the comms # MQTT5_SWIG_SRC_DIR - Path to the commsdsl2swig sources. If not provided local "src/swig" dir is used. # MQTT5_SWIG_LANGUAGES - Languages list to support by swig. If not provided "python java csharp" are chosen # MQTT5_EMSCRIPTEN_OUTPUT_DIR - Path to emscripten output directory. If not provided /output_emscripten one is used. +# MQTT5_CCACHE_EXECUTABLE - Custom ccache executable # COMMSDSL2COMMS_EXTRA_ARGS - Extra arguments to pass to "commsdsl2comms" # COMMSDSL2TEST_EXTRA_ARGS - Extra arguments to pass to "commsdsl2test" # COMMSDSL2TOOLS_QT_EXTRA_ARGS - Extra arguments to pass to "commsdsl2tools_qt" # COMMSDSL2SWIG_EXTRA_ARGS - Extra arguments to pass to "commsdsl2swig" # COMMSDSL2EMSCRIPTEN_EXTRA_ARGS - Extra arguments to pass to "commsdsl2emscripten" -set (MQTT5_VERSION "2.7") -set (MQTT5_MIN_COMMSDSL_VERSION "6.3.2") +set (MQTT5_VERSION "2.8") +set (MQTT5_MIN_COMMSDSL_VERSION "6.3.3") set (EXTERNALS_DIR "${PROJECT_SOURCE_DIR}/externals") @@ -201,6 +202,8 @@ if (MQTT5_GEN_TEST) -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_EXE_LINKER_FLAGS=${CMAKE_EXE_LINKER_FLAGS} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DCMAKE_PREFIX_PATH=${combined_prefix_path_str} + -DOPT_USE_CCACHE=${MQTT5_USE_CCACHE} + -DOPT_CCACHE_EXECUTABLE=${MQTT5_CCACHE_EXECUTABLE} ) endif () endif () @@ -260,6 +263,8 @@ if (MQTT5_GEN_TOOLS) -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_EXE_LINKER_FLAGS=${CMAKE_EXE_LINKER_FLAGS} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DCMAKE_PREFIX_PATH=${combined_prefix_path_str} -DOPT_QT_MAJOR_VERSION=${MQTT5_TOOLS_QT_VER} + -DOPT_USE_CCACHE=${MQTT5_USE_CCACHE} + -DOPT_CCACHE_EXECUTABLE=${MQTT5_CCACHE_EXECUTABLE} ) endif () endif () @@ -321,6 +326,8 @@ if (MQTT5_GEN_SWIG) -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DCMAKE_PREFIX_PATH=${combined_prefix_path_str} -DOPT_SWIG_LANGUAGES=${combined_languages_str} + -DOPT_USE_CCACHE=${MQTT5_USE_CCACHE} + -DOPT_CCACHE_EXECUTABLE=${MQTT5_CCACHE_EXECUTABLE} INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "Skipping install" ) @@ -389,6 +396,8 @@ if (MQTT5_GEN_EMSCRIPTEN) -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DOPT_MODULARIZE=ON -DOPT_EXTRA_INCLUDE_DIRS=${extra_includes_path_str} + -DOPT_USE_CCACHE=${MQTT5_USE_CCACHE} + -DOPT_CCACHE_EXECUTABLE=${MQTT5_CCACHE_EXECUTABLE} ) endif () endif () diff --git a/README.md b/README.md index 9816654..c7314e5 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,15 @@ project is used to generate C++11 code of the protocol implementation. The [src](src) folder contains additional and/or overriding default functionality code snippets, that get injected into the generated code. -The generated CMake project of this protocol definition is hosted and can be -viewed at [cc.mqtt5.generated](https://github.com/commschamp/cc.mqtt5.generated) +The code generators from the [commsdsl](https://github.com/commschamp/commsdsl) +repository generate full CMake projects. +Some of these **generated** projects are hosted as separate +repositories that can be viewed and used independently. + +- [cc.mqtt5.generated](https://github.com/commschamp/cc.mqtt5.generated) - Protocol + definition +- [cc.mqtt5_protocol.cc_tools_plugin](https://github.com/commschamp/cc.mqtt5_protocol.cc_tools_plugin) - + Protocol plugin for the [CommsChampion Tools](https://github.com/commschamp/cc_tools_qt). # License Please read [License](https://github.com/commschamp/commsdsl#license) @@ -25,7 +32,7 @@ mentioned available parameters, which can be used in addition to standard ones provided by CMake itself, to modify the default build. This project also has external dependencies, it requires an access to -the [COMMS Library](https://github.com/commschamp/commsdsl) and +the [COMMS Library](https://github.com/commschamp/comms) and code generators from [commsdsl](https://github.com/commschamp/commsdsl) projects. These dependencies are expected to be built independenty and access to them provided via standard **CMAKE_PREFIX_PATH** and/or **CMAKE_PROGRAM_PATH** (for the binaries of @@ -33,8 +40,7 @@ the code generators). There are also scripts ( [script/prepare_externals.sh](script/prepare_externals.sh) for Linux and [script/prepare_externals.bat](script/prepare_externals.bat) for Windows) which can help in preparation of these dependencies. They are also used -in configuration of the [github actions](.github/workflows/actions_build.yml) and -[appveyor](.appveyor.yml). +in configuration of the [github actions](.github/workflows/actions_build.yml). The project's cmake configuration [options](CMakeLists.txt) allow building bindings to other high level programming languages using [swig](https://www.swig.org/) diff --git a/script/appveyor_install.bat b/script/appveyor_install.bat deleted file mode 100644 index d9e10de..0000000 --- a/script/appveyor_install.bat +++ /dev/null @@ -1,82 +0,0 @@ -IF "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" ( - set TOOLCHAIN=msvc14 - set QT_SUBDIR=msvc2015 - set QT_VER=5.6 - set CMAKE_GENERATOR=NMake Makefiles - IF "%PLATFORM%"=="x86" ( - echo Performing x86 build in VS2015 - call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 - ) ELSE ( - echo Performing amd64 build in VS2015 - call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64 - ) -) ELSE IF "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" ( - set TOOLCHAIN=msvc15 - set QT_SUBDIR=msvc2017 - set QT_VER=5.13 - set CMAKE_GENERATOR=NMake Makefiles - IF "%PLATFORM%"=="x86" ( - echo Performing x86 build in VS2017 - call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat" - ) ELSE ( - echo Performing amd64 build in VS2017 - call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" - ) - -) ELSE IF "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2019" ( - set TOOLCHAIN=msvc16 - set QT_SUBDIR=msvc2019 - IF "%QT_MAJOR%"=="6" ( - set QT_VER=6.4 - ) ELSE ( - set QT_VER=5.15 - ) - set CMAKE_GENERATOR=Visual Studio 16 2019 - set CMAKE_PLATFORM=Win32 - IF "%PLATFORM%"=="x86" ( - echo Performing x86 build in VS2019 - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars32.bat" - ) ELSE ( - echo Performing amd64 build in VS2019 - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" - set CMAKE_PLATFORM=x64 - ) - -) ELSE IF "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2022" ( - set TOOLCHAIN=msvc17 - set QT_SUBDIR=msvc2019 - IF "%QT_MAJOR%"=="6" ( - set QT_VER=6.4 - ) ELSE ( - set QT_VER=5.15 - ) - set CMAKE_GENERATOR=Visual Studio 17 2022 - IF "%PLATFORM%"=="x86" ( - echo Performing x86 build in VS2022 - call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars32.bat" - set CMAKE_PLATFORM=Win32 - ) ELSE ( - echo Performing amd64 build in VS2022 - call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" - set CMAKE_PLATFORM=x64 - ) -) ELSE ( - echo Toolchain %TOOLCHAIN% is not supported - exit -1 -) - -set QTDIR_PREFIX=C:/Qt/%QT_VER% -IF "%PLATFORM%"=="x86" ( - set QTDIR_SUFFIX= -) ELSE ( - set QTDIR_SUFFIX=_64 -) - -set QTDIR=%QTDIR_PREFIX%/%QT_SUBDIR%%QTDIR_SUFFIX% -IF NOT EXIST %QTDIR% ( - echo WARNING: %QTDIR% does not exist!!! - set QTDIR=%QTDIR_PREFIX%/msvc2015%QTDIR_SUFFIX% -) - -echo Using Qt from %QTDIR% - diff --git a/script/full_debug_build.sh b/script/full_debug_build.sh index 69723d3..ed8c40f 100755 --- a/script/full_debug_build.sh +++ b/script/full_debug_build.sh @@ -11,6 +11,7 @@ export BUILD_DIR="${ROOT_DIR}/build.full.${CC}" export COMMON_INSTALL_DIR=${BUILD_DIR}/install export COMMON_BUILD_TYPE=Debug export EXTERNALS_DIR=${ROOT_DIR}/externals +export COMMON_USE_CCACHE=ON mkdir -p ${BUILD_DIR} ${SCRIPT_DIR}/prepare_externals.sh @@ -18,7 +19,8 @@ ${SCRIPT_DIR}/prepare_externals.sh cd ${BUILD_DIR} cmake .. -DCMAKE_INSTALL_PREFIX=${COMMON_INSTALL_DIR} \ -DCMAKE_BUILD_TYPE=Debug -DMQTT5_GEN_TEST=ON -DMQTT5_BUILD_PROT_DOC=ON \ - -DMQTT5_GEN_TOOLS=ON -DMQTT5_GEN_SWIG=ON -DMQTT5_GEN_EMSCRIPTEN=ON "$@" + -DMQTT5_GEN_TOOLS=ON -DMQTT5_GEN_SWIG=ON -DMQTT5_GEN_EMSCRIPTEN=ON \ + -DMQTT5_USE_CCACHE=ON "$@" procs=$(nproc) if [ -n "${procs}" ]; then diff --git a/script/prepare_externals.sh b/script/prepare_externals.sh index e07d3af..0ff0bf2 100755 --- a/script/prepare_externals.sh +++ b/script/prepare_externals.sh @@ -19,6 +19,8 @@ # COMMON_CXX_STANDARD - (Optional) CMake C++ standard # COMMON_CMAKE_GENERATOR - (Optional) CMake generator # COMMON_CMAKE_PLATFORM - (Optional) CMake platform +# COMMON_USE_CCACHE - (Optional) Common "use ccache" parameter +# COMMON_CCACHE_EXECUTABLE - (Optional) Common ccache executable ##################################### @@ -141,6 +143,8 @@ function build_commsdsl() { CC=${CC_COMMSDSL} CXX=${CXX_COMMSDSL} cmake \ -S ${COMMSDSL_SRC_DIR} -B ${COMMSDSL_BUILD_DIR} \ -DCMAKE_INSTALL_PREFIX=${COMMSDSL_INSTALL_DIR} -DCMAKE_BUILD_TYPE=${COMMON_BUILD_TYPE} \ + ${COMMON_USE_CCACHE:+"-DCOMMSDSL_USE_CCACHE=${COMMON_USE_CCACHE}"} \ + ${COMMON_CCACHE_EXECUTABLE:+"-DCOMMSDSL_CCACHE_EXECUTABLE=${COMMON_CCACHE_EXECUTABLE}"} \ -DCOMMSDSL_INSTALL_LIBRARY=OFF -DCOMMSDSL_BUILD_COMMSDSL2TEST=ON -DCOMMSDSL_BUILD_COMMSDSL2TOOLS_QT=ON \ -DCOMMSDSL_BUILD_COMMSDSL2SWIG=ON -DCOMMSDSL_BUILD_COMMSDSL2EMSCRIPTEN=ON cmake --build ${COMMSDSL_BUILD_DIR} --config ${COMMON_BUILD_TYPE} --target install ${procs_param} @@ -172,6 +176,8 @@ function build_cc_tools_qt() { cmake \ ${COMMON_CMAKE_GENERATOR:+"-G ${COMMON_CMAKE_GENERATOR}"} ${COMMON_CMAKE_PLATFORM:+"-A ${COMMON_CMAKE_PLATFORM}"} \ -S ${CC_TOOLS_QT_SRC_DIR} -B ${CC_TOOLS_QT_BUILD_DIR} -DCMAKE_INSTALL_PREFIX=${CC_TOOLS_QT_INSTALL_DIR} \ + ${COMMON_USE_CCACHE:+"-DCC_TOOLS_QT_USE_CCACHE=${COMMON_USE_CCACHE}"} \ + ${COMMON_CCACHE_EXECUTABLE:+"-DCC_TOOLS_QT_CCACHE_EXECUTABLE=${COMMON_CCACHE_EXECUTABLE}"} \ -DCMAKE_BUILD_TYPE=${COMMON_BUILD_TYPE} -DCC_TOOLS_QT_BUILD_APPS=OFF -DCMAKE_PREFIX_PATH=${COMMS_INSTALL_DIR} \ -DCMAKE_CXX_STANDARD=${COMMON_CXX_STANDARD} ${CC_TOOLS_QT_VERSION_OPT} cmake --build ${CC_TOOLS_QT_BUILD_DIR} --config ${COMMON_BUILD_TYPE} --target install ${procs_param}