summaryrefslogtreecommitdiffstats
path: root/packaging/macosx
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2020-09-12 17:35:37 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-09-13 13:55:46 -0700
commit53ea3b496473d11f2f41897a23d08cb5d10b24d3 (patch)
tree1ce45a1cca03f2eedd01f5efc254a4359f2f533f /packaging/macosx
parent3825fbbf72ecb75ffba628ae4d891bb5b8fff4f4 (diff)
downloadsubsurface-53ea3b496473d11f2f41897a23d08cb5d10b24d3.tar.gz
build-system/macOS: use consistent code to pick SDK
Hardcoding versions was kinda silly. This now matches what's in build.sh. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'packaging/macosx')
-rwxr-xr-xpackaging/macosx/make-package.sh14
1 files changed, 13 insertions, 1 deletions
diff --git a/packaging/macosx/make-package.sh b/packaging/macosx/make-package.sh
index 264f71d8e..c1cafe177 100755
--- a/packaging/macosx/make-package.sh
+++ b/packaging/macosx/make-package.sh
@@ -18,7 +18,19 @@ VERSION=$(cd ${DIR}/subsurface; ./scripts/get-version linux)
# first build and install Subsurface and then clean up the staging area
# make sure we didn't lose the minimum OS version
rm -rf ./Subsurface.app
-cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk .
+if [ -d /Developer/SDKs ] ; then
+ SDKROOT=/Developer/SDKs
+elif [ -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs ] ; then
+ SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
+else
+ echo "Cannot find SDK sysroot (usually /Developer/SDKs or"
+ echo "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs)"
+ exit 1;
+fi
+BASESDK=$(ls $SDKROOT | grep "MacOSX10\.1.\.sdk" | head -1 | sed -e "s/MacOSX//;s/\.sdk//")
+OLDER_MAC_CMAKE="-DCMAKE_OSX_DEPLOYMENT_TARGET=${BASESDK} -DCMAKE_OSX_SYSROOT=${SDKROOT}/MacOSX${BASESDK}.sdk/"
+export PKG_CONFIG_PATH=${DIR}/install-root/lib/pkgconfig:$PKG_CONFIG_PATH
+cmake $OLDER_MAC_CMAKE .
LIBRARY_PATH=${DIR}/install-root/lib make -j8
LIBRARY_PATH=${DIR}/install-root/lib make install