From f5daa9f76bcf31bab61feefc668de523bc667c2f Mon Sep 17 00:00:00 2001 From: Tao Xu Date: Thu, 4 Nov 2021 16:44:44 -0700 Subject: [PATCH] [iOS] Enable ARC for CMake build (#67884) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/67884 Test Plan: Imported from OSS Reviewed By: husthyc Differential Revision: D32191532 Pulled By: xta0 fbshipit-source-id: a295004f8e7f1b0f5a4ab12ffd9b37c36b80226b --- scripts/build_ios.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/build_ios.sh b/scripts/build_ios.sh index 7c5669ee852..4158b27365c 100755 --- a/scripts/build_ios.sh +++ b/scripts/build_ios.sh @@ -176,6 +176,9 @@ if [ "${VERBOSE:-}" == '1' ]; then CMAKE_ARGS+=("-DCMAKE_VERBOSE_MAKEFILE=1") fi +# enable ARC +CMAKE_ARGS+=("-DCMAKE_CXX_FLAGS=-fobjc-arc") + # Now, actually build the iOS target. BUILD_ROOT=${BUILD_ROOT:-"$CAFFE2_ROOT/build_ios"} INSTALL_PREFIX=${BUILD_ROOT}/install