diff options
author | jperkin <jperkin@pkgsrc.org> | 2021-07-17 06:34:20 +0000 |
---|---|---|
committer | jperkin <jperkin@pkgsrc.org> | 2021-07-17 06:34:20 +0000 |
commit | ff930c69d658824939e7751dc3082a8f327c0533 (patch) | |
tree | ad9ec8ad912396dcb898b9b56e6bd2d14b9d7831 /mk | |
parent | af463f7a5bc403f742171d966e760dc21584a7d3 (diff) | |
download | pkgsrc-ff930c69d658824939e7751dc3082a8f327c0533.tar.gz |
mk: Enforce arm64 host CPU for Darwin/aarch64.
Fixes builds inside an x86_64 chroot where packages add x86-specific flags
based on the output of uname even though we're building for aarch64. CMake
provides the CMAKE_APPLE_SILICON_PROCESSOR variable for this situation.
Diffstat (limited to 'mk')
-rw-r--r-- | mk/configure/cmake.mk | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mk/configure/cmake.mk b/mk/configure/cmake.mk index 60b7f71886d..4a8bd734e8b 100644 --- a/mk/configure/cmake.mk +++ b/mk/configure/cmake.mk @@ -1,4 +1,4 @@ -# $NetBSD: cmake.mk,v 1.20 2020/08/12 14:10:11 schmonz Exp $ +# $NetBSD: cmake.mk,v 1.21 2021/07/17 06:34:20 jperkin Exp $ # # This file handles packages that use CMake as their primary build # system. For more information about CMake, see http://www.cmake.org/. @@ -71,6 +71,9 @@ CMAKE_ARGS+= -DCMAKE_INSTALL_INFODIR:PATH=${PKGINFODIR} CMAKE_ARGS+= -DCMAKE_INSTALL_LOCALEDIR:PATH=${PKGLOCALEDIR}/locale . endif .endif +.if !empty(MACHINE_PLATFORM:MDarwin-*-aarch64) +CMAKE_ARGS+= -DCMAKE_APPLE_SILICON_PROCESSOR=arm64 +.endif .if defined(CMAKE_PREFIX_PATH) CMAKE_ARGS+=-DCMAKE_PREFIX_PATH:PATH=${CMAKE_PREFIX_PATH:ts;:Q} |