gcc15 AVR compilation fixes (#25238)

This commit is contained in:
Nick Brassel 2025-05-19 09:22:31 +10:00 committed by GitHub
parent 81355045cc
commit a4ef1ae736
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 22 additions and 5 deletions

View file

@ -11,6 +11,7 @@ endif
.DEFAULT_GOAL := all
include paths.mk
include $(BUILDDEFS_PATH)/support.mk
include $(BUILDDEFS_PATH)/message.mk
# Helper to add defines with a 'QMK_' prefix

View file

@ -7,6 +7,7 @@ endif
OPT = g
include paths.mk
include $(BUILDDEFS_PATH)/support.mk
include $(BUILDDEFS_PATH)/message.mk
TARGET=test/$(TEST_OUTPUT)

11
builddefs/support.mk Normal file
View file

@ -0,0 +1,11 @@
# Helper to determine if a compiler option is supported
# Args:
# $(1) = option to test, if successful will be output
# $(2) = option to use if $(1) is not supported
# $(3) = additional arguments to pass to the compiler during the test, but aren't contained in the output
cc-option = $(shell \
if { echo 'int main(){return 0;}' | $(CC) $(1) $(3) -o /dev/null -x c /dev/null >/dev/null 2>&1; }; \
then echo "$(1)"; else echo "$(2)"; fi)
# Helper to pass comma character to make functions (use with `$(,)` to pass in `$(call ...)` arguments)
, := ,