From c8258e6525372f4bdc802ff6b21e553903aebd7b Mon Sep 17 00:00:00 2001 From: Paolo Bosetti Date: Fri, 21 Jun 2024 12:52:48 +0200 Subject: [PATCH] chore: Enable building only plugins without external dependencies --- .github/workflows/cmake-multi-platform.yml | 1 + CMakeLists.txt | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 9468138..55ba371 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -62,6 +62,7 @@ jobs: -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + -DMADS_NO_DEPS_ONLY=ON -S ${{ github.workspace }} - name: Build diff --git a/CMakeLists.txt b/CMakeLists.txt index 7535f3d..29de3ca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,8 @@ cmake_minimum_required(VERSION 3.20) project(plugin VERSION 0.1.0 LANGUAGES CXX) set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE) +option(MADS_NO_DEPS_ONLY "Build only plugins without external dependencies" OFF) + # PROJECT SETTINGS ############################################################# set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -118,10 +120,13 @@ add_plugin(echoj) add_plugin(clock) add_plugin(to_console) add_plugin(random) -add_plugin(mqtt LIBS mosquittopp) add_plugin(serial_reader SRCS ${SRC_DIR}/serialport.cpp) add_plugin(running_avg) +if(NOT MADS_NO_DEPS_ONLY) + add_plugin(mqtt LIBS mosquittopp) +endif() + if (APPLE) add_plugin(restway LIBS restclient-cpp) endif()