mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
c++17
This commit is contained in:
20
Makefile
20
Makefile
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# GNUMakefile for EMS-ESP
|
||||
# (c) 2020 Paul Derbyshire
|
||||
#
|
||||
|
||||
NUMJOBS=${NUMJOBS:-" -j4 "}
|
||||
MAKEFLAGS+="j "
|
||||
#----------------------------------------------------------------------
|
||||
@@ -17,23 +17,25 @@ MAKEFLAGS+="j "
|
||||
#TARGET := $(notdir $(CURDIR))
|
||||
TARGET := emsesp
|
||||
BUILD := build
|
||||
SOURCES := src src/* lib_standalone lib/uuid-common/src lib/uuid-console/src lib/uuid-log/src src/devices lib/ArduinoJson/src lib/PButton
|
||||
INCLUDES := src lib_standalone lib/ArduinoJson/src lib/uuid-common/src lib/uuid-console/src lib/uuid-log/src lib/uuid-telnet/src lib/uuid-syslog/src lib/* src/devices
|
||||
SOURCES := src src/* lib_standalone lib/uuid-common/src lib/uuid-console/src lib/uuid-log/src src/devices lib/ArduinoJson/src lib/PButton lib/semver
|
||||
INCLUDES := src lib_standalone lib/ArduinoJson/src lib/uuid-common/src lib/uuid-console/src lib/uuid-log/src lib/uuid-telnet/src lib/uuid-syslog/src lib/semver lib/* src/devices
|
||||
LIBRARIES :=
|
||||
|
||||
CPPCHECK = cppcheck
|
||||
CHECKFLAGS = -q --force --std=c++11
|
||||
CHECKFLAGS = -q --force --std=c++17
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
# Languages Standard
|
||||
#----------------------------------------------------------------------
|
||||
C_STANDARD := -std=c11
|
||||
CXX_STANDARD := -std=c++11
|
||||
C_STANDARD := -std=c17
|
||||
CXX_STANDARD := -std=c++17
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
# Defined Symbols
|
||||
#----------------------------------------------------------------------
|
||||
DEFINES += -DFACTORY_WIFI_HOSTNAME=\"ems-esp\" -DARDUINOJSON_ENABLE_STD_STRING=1 -DARDUINOJSON_ENABLE_PROGMEM=1 -DARDUINOJSON_ENABLE_ARDUINO_STRING -DARDUINOJSON_USE_DOUBLE=0 -DEMSESP_DEBUG -DEMSESP_STANDALONE -DEMSESP_USE_SERIAL -DEMSESP_DEFAULT_BOARD_PROFILE=\"LOLIN\"
|
||||
DEFINES += -DARDUINOJSON_ENABLE_STD_STRING=1 -DARDUINOJSON_ENABLE_PROGMEM=1 -DARDUINOJSON_ENABLE_ARDUINO_STRING -DARDUINOJSON_USE_DOUBLE=0 -DEMSESP_DEBUG -DEMSESP_STANDALONE -DEMSESP_USE_SERIAL
|
||||
|
||||
DEFAULTS = -DEMSESP_DEFAULT_LOCALE=\"en\" -DEMSESP_DEFAULT_TX_MODE=8 -DEMSESP_DEFAULT_VERSION=\"3.5.0b11\" -DEMSESP_DEFAULT_BOARD_PROFILE=\"S32\"
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
# Sources & Files
|
||||
@@ -66,7 +68,7 @@ CXX := /usr/bin/g++
|
||||
# CXXFLAGS C++ Compiler Flags
|
||||
# LDFLAGS Linker Flags
|
||||
#----------------------------------------------------------------------
|
||||
CPPFLAGS += $(DEFINES) $(INCLUDE)
|
||||
CPPFLAGS += $(DEFINES) $(DEFAULTS) $(INCLUDE)
|
||||
CPPFLAGS += -ggdb
|
||||
CPPFLAGS += -g3
|
||||
CPPFLAGS += -Os
|
||||
@@ -114,6 +116,8 @@ COMPILE.cpp = $(CXX) $(CXX_STANDARD) $(CXXFLAGS) $(DEPFLAGS) -c $< -o $@
|
||||
# Targets
|
||||
#----------------------------------------------------------------------
|
||||
.PHONY: all
|
||||
.SILENT: $(OUTPUT)
|
||||
|
||||
all: $(OUTPUT)
|
||||
|
||||
$(OUTPUT): $(OBJS)
|
||||
|
||||
@@ -2,11 +2,12 @@
|
||||
|
||||
[common]
|
||||
; custom build flags
|
||||
; options are: EMSESP_DEBUG, EMSESP_UART_DEBUG, EMSESP_DEBUG_SENSOR, EMSESP_WIFI_TWEAK, EMSESP_DEFAULT_BOARD_PROFILE
|
||||
; options are: EMSESP_DEBUG, EMSESP_UART_DEBUG, EMSESP_DEBUG_SENSOR, EMSESP_WIFI_TWEAK, EMSESP_DEFAULT_BOARD_PROFILE EMSESP_DEBUG_LIMITED
|
||||
; my_build_flags = -DEMSESP_DEBUG -DEMSESP_DEFAULT_BOARD_PROFILE=\"NODEMCU\"
|
||||
; my_build_flags = -DEMSESP_DEBUG_SENSOR
|
||||
; my_build_flags = -DEMSESP_DEBUG -DEMSESP_USE_SERIAL
|
||||
; my_build_flags = -DEMSESP_DEBUG -DCORE_DEBUG_LEVEL=5 ; 5=verbose, 4=debug, 3=info
|
||||
my_build_flags = -DEMSESP_DEBUG -DEMSESP_DEBUG_LIMITED -DEMSESP_USE_SERIAL
|
||||
|
||||
[env:esp32_4M]
|
||||
; if using OTA enter your details below
|
||||
|
||||
@@ -11,13 +11,15 @@ extra_configs =
|
||||
|
||||
[common]
|
||||
core_build_flags =
|
||||
-Wall
|
||||
; -Wall -Wextra -Werror -Wswitch-enum -Wno-unused-parameter
|
||||
-D CORE_DEBUG_LEVEL=0
|
||||
-D NDEBUG
|
||||
-D ARDUINO_ARCH_ESP32=1
|
||||
-D ESP32=1
|
||||
-std=gnu++17 -Os
|
||||
|
||||
core_unbuild_flags =
|
||||
core_unbuild_flags = -std=gnu++11
|
||||
; core_unbuild_flags =
|
||||
|
||||
; my_build_flags is set in pio_local.ini
|
||||
my_build_flags =
|
||||
@@ -42,7 +44,6 @@ monitor_raw = yes
|
||||
upload_speed = 921600
|
||||
build_type = release
|
||||
lib_ldf_mode = chain+
|
||||
debug_build_flags = -Os # optimize for size
|
||||
|
||||
check_tool = cppcheck, clangtidy
|
||||
check_severity = high, medium
|
||||
@@ -57,6 +58,7 @@ extra_scripts = scripts/rename_fw.py
|
||||
board = esp32dev
|
||||
platform = espressif32
|
||||
board_build.partitions = esp32_partition_4M.csv
|
||||
board_build.filesystem = littlefs
|
||||
build_flags = ${common.build_flags}
|
||||
build_unflags = ${common.unbuild_flags}
|
||||
|
||||
@@ -66,6 +68,8 @@ extra_scripts =
|
||||
scripts/rename_fw.py
|
||||
board = esp32dev
|
||||
platform = espressif32
|
||||
; platform_packages =
|
||||
; framework-arduinoespressif32@3.20005.220925
|
||||
board_upload.flash_size = 4MB
|
||||
board_build.partitions = esp32_partition_4M.csv
|
||||
build_flags = ${common.build_flags}
|
||||
|
||||
Reference in New Issue
Block a user