From 0cfe83d60b5952d1fed7c3c7a7b2bfdeccbe6f63 Mon Sep 17 00:00:00 2001 From: Steve Karg Date: Wed, 13 Sep 2023 16:32:07 -0500 Subject: [PATCH] add support for building with deprecation bypass --- CMakeLists.txt | 9 +++++++ aptfile | 52 ++++++++++++++++++++++++++++++++++++++++ ports/atmega168/Makefile | 5 ++++ 3 files changed, 66 insertions(+) create mode 100644 aptfile diff --git a/CMakeLists.txt b/CMakeLists.txt index d04ad7ec..6ff09b25 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,6 +70,15 @@ if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif() +option( + BACNET_STACK_DEPRECATED_DISABLE + "Disable deprecation compile warnings" + ON) + +if(BACNET_STACK_DEPRECATED_DISABLE) + add_definitions(-DBACNET_STACK_DEPRECATED_DISABLE) +endif() + set(CMAKE_CXX_FLAGS "-Wall -Wextra") set(CMAKE_CXX_FLAGS_DEBUG "-g") set(CMAKE_CXX_FLAGS_RELEASE "-O3") diff --git a/aptfile b/aptfile new file mode 100644 index 00000000..2daf4080 --- /dev/null +++ b/aptfile @@ -0,0 +1,52 @@ +#!/usr/bin/env aptfile +# ^ note the above shebang +# https://github.com/seatgeek/bash-aptfile + +# trigger an apt-get update +update + +# install core development packages +package "build-essential" +package "cmake" +package "lcov" +package "clang" +package "gcc" +package "libconfig-dev" +package "liblwip-dev" +package "mingw-w64" + +# install git and useful tools packages +package "git" +package "gitk" +package "gitg" + +# install source code format packages +package "tofrodos" +package "clang-format" +package "sloccount" + +# install ARM compiler and debugging tools +package "gcc-arm-none-eabi" +package "binutils-arm-none-eabi" +package "picolibc-arm-none-eabi" +package "gdb-multiarch" + +# install AVR compiler and debugging tools +package "gcc-avr" +package "avarice" +package "avr-libc" +package "avrdude" +package "gdb-avr" +package "avrdude-doc" + +# install static analysis tools +package "flawfinder" +package "cppcheck" +package "splint" +package "clang-tools" +package "clang-tidy" +package "codespell" + +# you can also execute arbitrary bash +echo "🚀 ALL GOOD TO GO" + diff --git a/ports/atmega168/Makefile b/ports/atmega168/Makefile index 4c8425b0..37a8c142 100644 --- a/ports/atmega168/Makefile +++ b/ports/atmega168/Makefile @@ -108,6 +108,11 @@ BFLAGS += -DBACAPP_CHARACTER_STRING BFLAGS += -DWRITE_PROPERTY BFLAGS += -DMAX_ANALOG_VALUES=10 BFLAGS += -DMAX_BINARY_VALUES=10 +ifeq (${LEGACY},true) +# disable deprecated function warnings for legacy builds +BFLAGS += -DBACNET_STACK_DEPRECATED_DISABLE +endif + CFLAGS = $(COMMON) # dead code removal CFLAGS += -ffunction-sections -fdata-sections