From 7e3d0bd4092ca40b3171205b319c0658afabf4e1 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Thu, 29 Feb 2024 00:59:09 +0000 Subject: [PATCH] Bug 1834947 - Divert xcrun so that it outputs the build system's chosen iOS SDK. r=firefox-build-system-reviewers,nalexander Differential Revision: https://phabricator.services.mozilla.com/D179033 --- build/macosx/xcrun | 10 ++++++++++ config/makefiles/rust.mk | 3 +++ 2 files changed, 13 insertions(+) create mode 100755 build/macosx/xcrun diff --git a/build/macosx/xcrun b/build/macosx/xcrun new file mode 100755 index 000000000000..7642586e3095 --- /dev/null +++ b/build/macosx/xcrun @@ -0,0 +1,10 @@ +#!/bin/sh + +case "$*" in +"--show-sdk-path --sdk iphoneos"|"--show-sdk-path -sdk iphoneos") + ;; +*) + echo We only expect this to be executed by third_party/rust/cc/src/lib.rs or rustc when targetting iOS >&2 + exit 1 +esac +echo $IPHONEOS_SDK_DIR diff --git a/config/makefiles/rust.mk b/config/makefiles/rust.mk index 5fdd6d937375..b10594f5cb8f 100644 --- a/config/makefiles/rust.mk +++ b/config/makefiles/rust.mk @@ -254,6 +254,9 @@ export COREAUDIO_SDK_PATH=$(MACOS_SDK_DIR) endif ifdef IPHONEOS_SDK_DIR export COREAUDIO_SDK_PATH=$(IPHONEOS_SDK_DIR) +# export for build/macosx/xcrun +export IPHONEOS_SDK_DIR +PATH := $(topsrcdir)/build/macosx:$(PATH) endif endif