git: ae8e32b08e33 - main - devel/qjson: Improve clang 16 workaround for usage of the 'register' keyword
Date: Sat, 08 Jul 2023 09:50:51 UTC
The branch main has been updated by rakuco: URL: https://cgit.FreeBSD.org/ports/commit/?id=ae8e32b08e33bac7aec0f14f28e45d53dee6f565 commit ae8e32b08e33bac7aec0f14f28e45d53dee6f565 Author: Raphael Kubo da Costa <rakuco@FreeBSD.org> AuthorDate: 2023-07-08 09:48:19 +0000 Commit: Raphael Kubo da Costa <rakuco@FreeBSD.org> CommitDate: 2023-07-08 09:50:36 +0000 devel/qjson: Improve clang 16 workaround for usage of the 'register' keyword Commit 3237ce1557467a3f89a3d1fa7a9308161665bf0c fixed the build on CURRENT with a heavy hammer that made register a macro. This change passes -Wno-register to the compiler instead, which is cleaner. Approved by: arrowd Differential Revision: https://reviews.freebsd.org/D40938 --- devel/qjson/Makefile | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/devel/qjson/Makefile b/devel/qjson/Makefile index 60f4d1401fb5..b2c2aa354718 100644 --- a/devel/qjson/Makefile +++ b/devel/qjson/Makefile @@ -29,12 +29,6 @@ OPTIONS_SUB= yes DOXYGEN_BUILD_DEPENDS= doxygen:devel/doxygen -.include <bsd.port.options.mk> - -.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1400091 -CXXFLAGS+= -Dregister= -.endif - post-build-DOXYGEN-on: cd ${WRKSRC}/doc && doxygen @@ -42,4 +36,12 @@ post-install-DOXYGEN-on: ${MKDIR} ${STAGEDIR}${_DOCSDIR} cd ${WRKSRC}/doc/html && ${COPYTREE_SHARE} . ${STAGEDIR}${_DOCSDIR} -.include <bsd.port.mk> +.include <bsd.port.pre.mk> + +# Clang 16 defaults to building in C++17, and throws an error when the +# `register' keyword is used. Make clang just ignore the keyword instead. +.if ${COMPILER_TYPE} == clang && ${COMPILER_VERSION} >= 160 +CXXFLAGS+= -Wno-register +.endif + +.include <bsd.port.post.mk>