Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ios_makefile.inc for TFLite iOS demo app #15191

Merged
merged 1 commit into from
Dec 8, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
78 changes: 47 additions & 31 deletions tensorflow/contrib/lite/ios_makefile.inc
Original file line number Diff line number Diff line change
@@ -1,31 +1,47 @@
#Settings for iOS.
ifeq($(TARGET), IOS) BUILD_FOR_IOS_SIMULATOR
: = false ifeq($(IOS_ARCH), x86_64) BUILD_FOR_IOS_SIMULATOR
: = true endif ifeq($(IOS_ARCH), i386) BUILD_FOR_IOS_SIMULATOR
: = true endif ifeq($(BUILD_FOR_IOS_SIMULATOR), true) IPHONEOS_PLATFORM
: = $(shell xcrun-- sdk iphonesimulator-- show - sdk - platform -
path) IPHONEOS_SYSROOT
: = $(shell xcrun-- sdk iphonesimulator-- show - sdk -
path) else IPHONEOS_PLATFORM
: = $(shell xcrun-- sdk iphoneos-- show - sdk - platform -
path) IPHONEOS_SYSROOT
: = $(shell xcrun-- sdk iphoneos-- show - sdk - path) endif IOS_SDK_VERSION
: = $(shell xcrun-- sdk iphoneos-- show - sdk - version) MIN_SDK_VERSION
: = 9.0
#Override IOS_ARCH with armv7, armv7s, arm64, i386, or x86_64.
IOS_ARCH
: = x86_64 CXXFLAGS
+= -miphoneos - version
- min = $(MIN_SDK_VERSION) - DGEMMLOWP_ALLOW_SLOW_SCALAR_FALLBACK
- fembed - bitcode - Wno - c++ 11 - narrowing - mno - thumb
- fno - exceptions
- isysroot ${IPHONEOS_SYSROOT} - arch $(IOS_ARCH) - O3 CCFLAGS
+= -miphoneos - version
- min = $(MIN_SDK_VERSION) - fembed - bitcode - mno - thumb
- isysroot ${IPHONEOS_SYSROOT} - arch $(IOS_ARCH) -
O3 LDFLAGS
: = -fembed - bitcode - miphoneos - version
- min = ${MIN_SDK_VERSION} - arch $(IOS_ARCH) OBJDIR
: = $(OBJDIR) ios_$(IOS_ARCH) / LIBDIR
: = $(LIBDIR) ios_$(IOS_ARCH) / BINDIR
: = $(BINDIR) ios_$(IOS_ARCH) / DEPDIR : = $(DEPDIR) ios_$(IOS_ARCH) / endif
# Settings for iOS.
ifeq ($(TARGET), IOS)
BUILD_FOR_IOS_SIMULATOR := false
ifeq ($(IOS_ARCH), x86_64)
BUILD_FOR_IOS_SIMULATOR := true
endif
ifeq ($(IOS_ARCH), i386)
BUILD_FOR_IOS_SIMULATOR := true
endif
ifeq ($(BUILD_FOR_IOS_SIMULATOR), true)
IPHONEOS_PLATFORM := $(shell xcrun --sdk iphonesimulator \
--show-sdk-platform-path)
IPHONEOS_SYSROOT := $(shell xcrun --sdk iphonesimulator \
--show-sdk-path)
else
IPHONEOS_PLATFORM := $(shell xcrun --sdk iphoneos --show-sdk-platform-path)
IPHONEOS_SYSROOT := $(shell xcrun --sdk iphoneos --show-sdk-path)
endif
IOS_SDK_VERSION := $(shell xcrun --sdk iphoneos --show-sdk-version)
MIN_SDK_VERSION := 9.0
# Override IOS_ARCH with armv7, armv7s, arm64, i386, or x86_64.
IOS_ARCH := x86_64
CXXFLAGS += -miphoneos-version-min=$(MIN_SDK_VERSION) \
-DGEMMLOWP_ALLOW_SLOW_SCALAR_FALLBACK \
-fembed-bitcode \
-Wno-c++11-narrowing \
-mno-thumb \
-fno-exceptions \
-isysroot \
${IPHONEOS_SYSROOT} \
-arch $(IOS_ARCH) \
-O3
CCFLAGS += -miphoneos-version-min=$(MIN_SDK_VERSION) \
-fembed-bitcode \
-mno-thumb \
-isysroot \
${IPHONEOS_SYSROOT} \
-arch $(IOS_ARCH) \
-O3
LDFLAGS := -fembed-bitcode \
-miphoneos-version-min=${MIN_SDK_VERSION} \
-arch $(IOS_ARCH)
OBJDIR := $(OBJDIR)ios_$(IOS_ARCH)/
LIBDIR := $(LIBDIR)ios_$(IOS_ARCH)/
BINDIR := $(BINDIR)ios_$(IOS_ARCH)/
DEPDIR := $(DEPDIR)ios_$(IOS_ARCH)/
endif