diff options
| author | Nick Brassel | 2025-05-19 01:22:31 +0200 |
|---|---|---|
| committer | GitHub | 2025-05-19 01:22:31 +0200 |
| commit | a4ef1ae736cd58375affed966cf1399fe8df5774 (patch) | |
| tree | e44dfc10fb79960bbe4c0e34c2b9130924cbc16f /builddefs/support.mk | |
| parent | 81355045cc7a59238485d340724a01f6d1d5d537 (diff) | |
gcc15 AVR compilation fixes (#25238)
Diffstat (limited to 'builddefs/support.mk')
| -rw-r--r-- | builddefs/support.mk | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/builddefs/support.mk b/builddefs/support.mk new file mode 100644 index 0000000000..7ef7b9b041 --- /dev/null +++ b/builddefs/support.mk @@ -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) +, := , |