]> git.lizzy.rs Git - rust.git/blob - tests/run-make/macos-deployment-target/Makefile
Rollup merge of #105784 - yanns:update_stdarch, r=Amanieu
[rust.git] / tests / run-make / macos-deployment-target / Makefile
1 # only-macos
2 #
3 # Check that a set deployment target actually makes it to the linker.
4 # This is important since its a compatibility hazard. The linker will
5 # generate load commands differently based on what minimum OS it can assume.
6
7 include ../../run-make-fulldeps/tools.mk
8
9 ifeq ($(strip $(shell uname -m)),arm64)
10         GREP_PATTERN = "minos 11.0"
11 else
12         GREP_PATTERN = "version 10.9"
13 endif
14
15 OUT_FILE=$(TMPDIR)/with_deployment_target.dylib
16 all:
17         env MACOSX_DEPLOYMENT_TARGET=10.9 $(RUSTC) with_deployment_target.rs -o $(OUT_FILE)
18 # XXX: The check is for either the x86_64 minimum OR the aarch64 minimum (M1 starts at macOS 11).
19 # They also use different load commands, so we let that change with each too. The aarch64 check
20 # isn't as robust as the x86 one, but testing both seems unneeded.
21         vtool -show-build $(OUT_FILE) | $(CGREP) -e $(GREP_PATTERN)