From 22738b649272c012b41a8338e1c99da9ba12a20c Mon Sep 17 00:00:00 2001 From: Matthew Selby Date: Tue, 13 May 2025 09:52:45 +0100 Subject: [PATCH] Add SYS_INCLUDE_DIRS to top level Makefile. Add directories in $(SYS_INCLUDE_DIRS) to the search path via -isystem. This allows a workaround for https://github.com/raspberrypi/pico-sdk/issues/2451 by using system headers, which are more tolerant of macro redefinitions. --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 456dc49dbc..7be4e6a6d2 100644 --- a/Makefile +++ b/Makefile @@ -305,6 +305,7 @@ EXTRA_WARNING_FLAGS := -Wold-style-definition CFLAGS += $(ARCH_FLAGS) \ $(addprefix -D,$(OPTIONS)) \ $(addprefix -I,$(INCLUDE_DIRS)) \ + $(addprefix -isystem,$(SYS_INCLUDE_DIRS)) \ $(DEBUG_FLAGS) \ -std=gnu17 \ -Wall -Wextra -Werror -Wunsafe-loop-optimizations -Wdouble-promotion \ @@ -331,6 +332,7 @@ ASFLAGS = $(ARCH_FLAGS) \ $(DEBUG_FLAGS) \ -x assembler-with-cpp \ $(addprefix -I,$(INCLUDE_DIRS)) \ + $(addprefix -isystem,$(SYS_INCLUDE_DIRS)) \ -MMD -MP ifeq ($(LD_FLAGS),) @@ -359,6 +361,7 @@ endif CPPCHECK = cppcheck $(CSOURCES) --enable=all --platform=unix64 \ --std=c99 --inline-suppr --quiet --force \ $(addprefix -I,$(INCLUDE_DIRS)) \ + $(addprefix -isystem,$(SYS_INCLUDE_DIRS)) \ -I/usr/include -I/usr/include/linux TARGET_NAME := $(TARGET)