git: 098dd441b435 - 2023Q4 - Mk/Uses/vala.mk: fix when COMPILER_TYPE=gcc

From: Robert Clausecker <fuz_at_FreeBSD.org>
Date: Thu, 19 Oct 2023 07:10:38 UTC
The branch 2023Q4 has been updated by fuz:

URL: https://cgit.FreeBSD.org/ports/commit/?id=098dd441b43582a9e8386d77d2dede5e7f563274

commit 098dd441b43582a9e8386d77d2dede5e7f563274
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2023-10-18 01:00:15 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-10-19 07:10:08 +0000

    Mk/Uses/vala.mk: fix when COMPILER_TYPE=gcc
    
    gcc does not support -Wno-error=incompatible-function-pointer-types.
    Only enable the warning for clang to fix various ports that fail to
    build with error messages like
    
    cc1: error: '-Wno-error=incompatible-function-pointer-types': no
    option '-Wincompatible-function-pointer-types'; did you mean
    '-Wincompatible-pointer-types'?
    
    MFH:            2023Q4
    (cherry picked from commit 4d0ab9e20997630f4ad6306c2fd12efb710ab2ac)
---
 Mk/Uses/vala.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Mk/Uses/vala.mk b/Mk/Uses/vala.mk
index 2e1b4e8d0388..a43969807a8a 100644
--- a/Mk/Uses/vala.mk
+++ b/Mk/Uses/vala.mk
@@ -24,7 +24,8 @@ BUILD_DEPENDS+=		${_VALA_BINARY}:${_VALA_PORT}
 .  endif
 
 # remove after https://gitlab.gnome.org/GNOME/vala/-/issues/1408 is fixed
-.  if ${ARCH} != powerpc
+.include "${USESDIR}/compiler.mk"
+.  if ${ARCH} != powerpc && ${CHOSEN_COMPILER_TYPE} == "clang"
 CFLAGS+=	-Wno-error=incompatible-function-pointer-types
 .  endif