1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-24 05:53:49 +01:00
RIOT/pkg/etl/Makefile.include
Marian Buschsieweke f46ab1cb67
pkg: Use -isystem instead of -I for pkg headers
We cannot fix package headers downstream, so we can just as well tell
the compiler to not warn about them.
2025-04-10 13:37:14 +02:00

46 lines
1.6 KiB
Makefile

# Hack: On LLVM, use `-isystem` instead of -I to ignore warnings about the
# package's headers. On g++ (at least the AVR variant), `-system` is C
# only. But luckily, g++ does not emit the warnings we need to ignore
# anyway.
ifeq (llvm,$(TOOLCHAIN))
INCLUDES += -isystem$(PKGDIRBASE)/etl/include
INCLUDES += -isystem$(RIOTPKG)/etl/config
else
INCLUDES += -I$(PKGDIRBASE)/etl/include
INCLUDES += -I$(RIOTPKG)/etl/config
endif
# There's nothing to build in this package, it's used as a header only library.
# So it's declared as a pseudo-module
PSEUDOMODULES += etl
# Activate the usage of libstdcpp types and features if available
# This prevents unnecessary reimplementations
ifneq (,$(filter libstdcpp,$(FEATURES_USED)))
CXXEXFLAGS += -DFEATURE_LIBSTDCPP
# Kconfig alternative
else ifdef CONFIG_KCONFIG_HAS_LIBSTDCPP
CXXEXFLAGS += -DFEATURE_LIBSTDCPP
endif
# Some boards don't provide NAN or by default don't define limits like UINT8_MAX in CPP context
# This activates the appropriate workarounds
ifneq (,$(filter arch_avr8,$(FEATURES_USED)))
CXXEXFLAGS += -DNO_CPP_NAN_SUPPORT
CXXEXFLAGS += -D__STDC_LIMIT_MACROS
else ifneq (,$(filter arch_riscv,$(FEATURES_USED)))
CXXEXFLAGS += -DNO_CPP_NAN_SUPPORT
CXXEXFLAGS += -D__STDC_LIMIT_MACROS
# Kconfig alternatives
else ifdef CONFIG_CPU_ARCH_AVR8
CXXEXFLAGS += -DNO_CPP_NAN_SUPPORT
CXXEXFLAGS += -D__STDC_LIMIT_MACROS
else ifdef CONFIG_CPU_ARCH_RISCV
CXXEXFLAGS += -DNO_CPP_NAN_SUPPORT
CXXEXFLAGS += -D__STDC_LIMIT_MACROS
endif
# Some compilers generate this warning. Due to -Werror it prevents this header-only library from compiling when included
CXXEXFLAGS += -Wno-unused-function