Skip to content

Commit

Permalink
Build Apple Intl with -fobjc-arc
Browse files Browse the repository at this point in the history
Summary:
Clang doesn't enable ARC in Objective-C by default, which means that
many of our Obj-C data structures are currently being leaked
incorrectly.

Reviewed By: jpporto

Differential Revision: D38684307

fbshipit-source-id: b31a4c405372de9b9097ef4809f4a217abd5f2b9
  • Loading branch information
neildhar authored and Dmitry Rykun committed Aug 16, 2022
1 parent bc97c53 commit 716d48b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/Platform/Intl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ if(HERMES_ENABLE_INTL)
)
# Work around a bug in unity builds where it tries to build Obj-C as C++.
set_target_properties(hermesPlatformIntl PROPERTIES UNITY_BUILD false)
target_compile_options(hermesPlatformIntl PRIVATE -fobjc-arc)
else()
add_hermes_library(hermesPlatformIntl STATIC PlatformIntlDummy.cpp LINK_LIBS hermesPublic)
endif()
Expand Down
2 changes: 2 additions & 0 deletions lib/Platform/Intl/PlatformIntlApple.mm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#import <Foundation/Foundation.h>
#include <unordered_set>

static_assert(__has_feature(objc_arc), "arc must be enabled");

namespace hermes {
namespace platform_intl {
namespace {
Expand Down

0 comments on commit 716d48b

Please sign in to comment.