Skip to content

Commit e443fb4

Browse files
committed
Fix misc MacVim project warnings in Xcode
Turn on parallel building, to remove the "Building targets in manual order is deprecated" project warning. Also, fix configure to only set macOS deployment target to the major version of macOS when automatically setting it from the client OS version. E.g. On macOS 13.2 it will set deployment to 13.0. This is useful because usually we don't want it to be as granular as the minor version which had caused issues in Homebrew before (Homebrew/homebrew-core#111693) where they had to fix on their end, and also 13.2 ends up being too new for Xcode which only expects to see up to 13.1 as deployment target. - Note that the logic used to work in OSX 10.X days because the "minor" version of X is actually the OS version, whereas in macOS 11/12/13 we now have versions like 13.2 where the first number is now the OS version. The configure script will now detect whether it's 10.X.Y or X.Y (X != 10) and set the correct target correspondingly.
1 parent 988f8b5 commit e443fb4

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

src/MacVim/MacVim.xcodeproj/project.pbxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -890,6 +890,7 @@
890890
29B97313FDCFA39411CA2CEA /* Project object */ = {
891891
isa = PBXProject;
892892
attributes = {
893+
BuildIndependentTargetsInParallel = YES;
893894
LastUpgradeCheck = 0710;
894895
};
895896
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "MacVim" */;

src/auto/configure

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4792,7 +4792,21 @@ rm -f core conftest.err conftest.$ac_objext \
47924792
conftest$ac_exeext conftest.$ac_ext
47934793
else
47944794
if test -z "$MACOSX_DEPLOYMENT_TARGET"; then
4795-
macosx_deployment_target=`/usr/bin/sw_vers -productVersion|/usr/bin/sed -e 's/^\([0-9]*\.[0-9]*\).*/\1/'`
4795+
# Deployment target not specified. We use the current OS' version. We
4796+
# only want to extract the main OS version but not the minor version for
4797+
# multiple reasons: it's more predictable if this is built from a CI to
4798+
# be deployed out (e.g. Homebrew), and sometimes deployment target
4799+
# that is too new will cause Xcode to complain (e.g. macOS is 13.2 while
4800+
# Xcode may only support up to 13.1)
4801+
macosx_major_version=`/usr/bin/sw_vers -productVersion|/usr/bin/sed -e 's/^\([0-9]*\)\.[0-9]*.*/\1/'`
4802+
macosx_minor_version=`/usr/bin/sw_vers -productVersion|/usr/bin/sed -e 's/^[0-9]*\.\([0-9]*\).*/\1/'`
4803+
if test "$macosx_major_version" = "10"; then
4804+
# Older versions look like 10.X.Y form where X is the main version.
4805+
macosx_deployment_target="$macosx_major_version.$macosx_minor_version"
4806+
else
4807+
# Since 11.0, We have X.Y.Z, where X is the main version.
4808+
macosx_deployment_target="$macosx_major_version.0"
4809+
fi
47964810
XCODEFLAGS="$XCODEFLAGS MACOSX_DEPLOYMENT_TARGET=$macosx_deployment_target"
47974811
else
47984812
XCODEFLAGS="$XCODEFLAGS MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET"

src/configure.ac

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,21 @@ if test "$vim_cv_uname_output" = Darwin; then
298298
LDFLAGS="$save_ldflags" ])
299299
else
300300
if test -z "$MACOSX_DEPLOYMENT_TARGET"; then
301-
macosx_deployment_target=`/usr/bin/sw_vers -productVersion|/usr/bin/sed -e 's/^\([[0-9]]*\.[[0-9]]*\).*/\1/'`
301+
# Deployment target not specified. We use the current OS' version. We
302+
# only want to extract the main OS version but not the minor version for
303+
# multiple reasons: it's more predictable if this is built from a CI to
304+
# be deployed out (e.g. Homebrew), and sometimes deployment target
305+
# that is too new will cause Xcode to complain (e.g. macOS is 13.2 while
306+
# Xcode may only support up to 13.1)
307+
macosx_major_version=`/usr/bin/sw_vers -productVersion|/usr/bin/sed -e 's/^\([[0-9]]*\)\.[[0-9]]*.*/\1/'`
308+
macosx_minor_version=`/usr/bin/sw_vers -productVersion|/usr/bin/sed -e 's/^[[0-9]]*\.\([[0-9]]*\).*/\1/'`
309+
if test "$macosx_major_version" = "10"; then
310+
# Older versions look like 10.X.Y form where X is the main version.
311+
macosx_deployment_target="$macosx_major_version.$macosx_minor_version"
312+
else
313+
# Since 11.0, We have X.Y.Z, where X is the main version.
314+
macosx_deployment_target="$macosx_major_version.0"
315+
fi
302316
XCODEFLAGS="$XCODEFLAGS MACOSX_DEPLOYMENT_TARGET=$macosx_deployment_target"
303317
else
304318
XCODEFLAGS="$XCODEFLAGS MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET"

0 commit comments

Comments
 (0)