Skip to content

Commit fa8a202

Browse files
committed
auto merge of #10203 : kud1ing/rust/ios, r=alexcrichton
This is based on the work by @dobkeratops, updated and extended to work for Xcode 5. This gets you going. I will add separate PRs for compilation/linking fixes. See also https://github.com/mozilla/rust/wiki/Doc-building-for-ios
2 parents 986d1f7 + 5864ad9 commit fa8a202

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

configure

+7
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,13 @@ do
670670
fi
671671
;;
672672

673+
arm-apple-darwin)
674+
if [ $CFG_OSTYPE != apple-darwin ]
675+
then
676+
err "The iOS target is only supported on Mac OS X"
677+
fi
678+
;;
679+
673680
*)
674681
;;
675682
esac

mk/platform.mk

+29
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,35 @@ CFG_LDPATH_i686-unknown-linux-gnu :=
193193
CFG_RUN_i686-unknown-linux-gnu=$(2)
194194
CFG_RUN_TARG_i686-unknown-linux-gnu=$(call CFG_RUN_i686-unknown-linux-gnu,,$(2))
195195

196+
# arm-apple-darwin configuration
197+
ifeq ($(CFG_OSTYPE),apple-darwin)
198+
CFG_IOS_SDK = $(shell xcrun --show-sdk-path -sdk iphoneos)
199+
CFG_IOS_FLAGS = -target arm-apple-darwin -isysroot $(CFG_IOS_SDK) -I $(CFG_IOS_SDK)/usr/include -I $(CFG_IOS_SDK)/usr/include/c++/4.2.1 -I /usr/include
200+
CC_arm-apple-darwin = $(shell xcrun -find -sdk iphoneos clang)
201+
CXX_arm-apple-darwin = $(shell xcrun -find -sdk iphoneos clang++)
202+
CPP_arm-apple-darwin = $(shell xcrun -find -sdk iphoneos clang++)
203+
AR_arm-apple-darwin = $(shell xcrun -find -sdk iphoneos ar)
204+
CFG_LIB_NAME_arm-apple-darwin = lib$(1).dylib
205+
CFG_LIB_GLOB_arm-apple-darwin = lib$(1)-*.dylib
206+
CFG_LIB_DSYM_GLOB_arm-apple-darwin = lib$(1)-*.dylib.dSYM
207+
CFG_GCCISH_CFLAGS_arm-apple-darwin := -Wall -Werror -g -fPIC $(CFG_IOS_FLAGS)
208+
CFG_GCCISH_CXXFLAGS_arm-apple-darwin := -fno-rtti $(CFG_IOS_FLAGS)
209+
CFG_GCCISH_LINK_FLAGS_arm-apple-darwin := -dynamiclib -lpthread -framework CoreServices -Wl,-no_compact_unwind
210+
CFG_GCCISH_DEF_FLAG_arm-apple-darwin := -Wl,-exported_symbols_list,
211+
CFG_GCCISH_PRE_LIB_FLAGS_arm-apple-darwin :=
212+
CFG_GCCISH_POST_LIB_FLAGS_arm-apple-darwin :=
213+
CFG_DEF_SUFFIX_arm-apple-darwin := .darwin.def
214+
CFG_INSTALL_NAME_arm-apple-darwin = -Wl,-install_name,@rpath/$(1)
215+
CFG_LIBUV_LINK_FLAGS_arm-apple-darwin =
216+
CFG_EXE_SUFFIX_arm-apple-darwin :=
217+
CFG_WINDOWSY_arm-apple-darwin :=
218+
CFG_UNIXY_arm-apple-darwin := 1
219+
CFG_PATH_MUNGE_arm-apple-darwin := true
220+
CFG_LDPATH_arm-apple-darwin :=
221+
CFG_RUN_arm-apple-darwin = $(2)
222+
CFG_RUN_TARG_arm-apple-darwin = $(call CFG_RUN_arm-apple-darwin,,$(2))
223+
endif
224+
196225
# x86_64-apple-darwin configuration
197226
CC_x86_64-apple-darwin=$(CC)
198227
CXX_x86_64-apple-darwin=$(CXX)

0 commit comments

Comments
 (0)