Re: git: 7efc3219b149 - main - lang/zig: build for lowest common denominator CPU

From: Jan Beich <jbeich_at_FreeBSD.org>
Date: Sun, 05 Feb 2023 06:00:27 UTC
Dave Cottlehuber <dch@FreeBSD.org> writes:

> +CMAKE_ARGS+=	-DZIG_TARGET_MCPU=baseline # ensure we run everywhere

Why did you ignore CPUTYPE suggestion by diizzy@ in review?
"native" is still useful when building zig itself locally.

See also https://cgit.freebsd.org/ports/commit/?id=96dff11bed89

diff --git a/lang/zig/Makefile b/lang/zig/Makefile
index 0b72faae67d6..5b53d19561cb 100644
--- a/lang/zig/Makefile
+++ b/lang/zig/Makefile
@@ -28,7 +28,7 @@ LIB_DEPENDS=	liblzma.so:archivers/lzma \
 
 USES=		cmake compiler:c++11-lang localbase:ldflags tar:xz
 CMAKE_ON=	THREADS_PREFER_PTHREAD_FLAG
-CMAKE_ARGS+=	-DZIG_TARGET_MCPU=baseline # ensure we run everywhere
+CMAKE_ARGS=	-DZIG_TARGET_MCPU="${CPUTYPE:Ubaseline}"
 
 OPTIONS_DEFINE=		DOCS STATIC
 OPTIONS_DEFAULT=	DOCS