Commit 08c67883 authored by Felix Paul Kühne's avatar Felix Paul Kühne

contrib: added support for iOS

parent d9d46900
......@@ -155,6 +155,24 @@ check_macosx_sdk()
add_make "OSX_VERSION ?= ${OSX_VERSION}"
}
check_ios_sdk()
{
if test -z "$SDKROOT"
then
SDKROOT=`xcode-select -print-path`/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs/iPhone${PLATFORM}${SDK_VERSION}.sdk
echo "SDKROOT not specified, assuming $SDKROOT"
else
SDKROOT="$SDKROOT"
fi
if [ ! -d "${SDKROOT}" ]
then
echo "*** ${SDKROOT} does not exist, please install required SDK, or set SDKROOT manually. ***"
exit 1
fi
add_make "SDKROOT=${SDKROOT}"
}
check_android_sdk()
{
[ -z "${ANDROID_NDK}" ] && echo "You must set ANDROID_NDK environment variable" && exit 1
......@@ -172,6 +190,7 @@ test -z "$ENABLE_SMALL" || add_make_enabled "ENABLE_SMALL"
#
case "${HOST}" in
arm-apple-darwin*)
check_ios_sdk
add_make_enabled "HAVE_IOS" "HAVE_DARWIN_OS" "HAVE_BSD"
;;
*86*-apple-darwin*)
......
......@@ -147,6 +147,17 @@ endif
endif
ifdef HAVE_IOS
CC=xcrun clang
CXX=xcrun clang++
AR=xcrun ar
LD=xcrun ld
STRIP=xcrun strip
RANLIB=xcrun ranlib
EXTRA_CFLAGS += -isysroot $(SDKROOT) -miphoneos-version-min=5.0
EXTRA_LDFLAGS += -Wl,-syslibroot,$(SDKROOT) -isysroot $(SDKROOT) -miphoneos-version-min=5.0
endif
ifdef HAVE_WIN32
ifneq ($(shell $(CC) $(CFLAGS) -E -dM -include _mingw.h - < /dev/null | grep -E __MINGW64_VERSION_MAJOR),)
HAVE_MINGW_W64 := 1
......@@ -380,7 +391,7 @@ ifdef HAVE_WIN32
echo "set(CMAKE_SYSTEM_NAME Windows)" >> $@
echo "set(CMAKE_RC_COMPILER $(HOST)-windres)" >> $@
endif
ifdef HAVE_MACOSX
ifdef HAVE_DARWIN_OS
echo "set(CMAKE_SYSTEM_NAME Darwin)" >> $@
echo "set(CMAKE_C_FLAGS $(CFLAGS))" >> $@
echo "set(CMAKE_CXX_FLAGS $(CFLAGS))" >> $@
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment