Skip to content

Commit 31bf620

Browse files
committed
Use the simulator deployment-target flag for simulator builds
-mios-version-min names the device platform, so against the simulator SDK the linker rejects every dylib it resolves there. Configuring for the simulator still exits 0, but conftest links fail and iconv, sqlite3 and zlib features are misdetected as absent; a build with a library on LDFLAGS before the first compiler check fails outright instead. The device/simulator split is already known from the host triple, so select the flag from it.
1 parent e8158d1 commit 31bf620

3 files changed

Lines changed: 20 additions & 4 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
iOS simulator builds are now configured with
2+
``-mios-simulator-version-min`` instead of the device's
3+
``-mios-version-min``. The device flag made the linker reject libraries
4+
resolved from the simulator SDK, so library detection silently failed.

configure

Lines changed: 9 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,8 +1008,13 @@ AS_CASE([$host],
10081008
dnl Add the compiler flag for the iOS minimum supported OS version.
10091009
AS_CASE([$ac_sys_system],
10101010
[iOS], [
1011-
AS_VAR_APPEND([CFLAGS], [" -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET}"])
1012-
AS_VAR_APPEND([LDFLAGS], [" -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET}"])
1011+
dnl -mios-version-min names the device platform; against the simulator SDK it
1012+
dnl makes the linker reject every dylib it resolves there.
1013+
AS_IF([test "x$_host_device" = "xsimulator"],
1014+
[_ios_version_min_flag=-mios-simulator-version-min],
1015+
[_ios_version_min_flag=-mios-version-min])
1016+
AS_VAR_APPEND([CFLAGS], [" ${_ios_version_min_flag}=${IPHONEOS_DEPLOYMENT_TARGET}"])
1017+
AS_VAR_APPEND([LDFLAGS], [" ${_ios_version_min_flag}=${IPHONEOS_DEPLOYMENT_TARGET}"])
10131018
],
10141019
)
10151020

0 commit comments

Comments
 (0)