Skip to content

Commit

Permalink
fix(hermes): fixed hermes build on iOS (#31559)
Browse files Browse the repository at this point in the history
Summary:
While testing 0.65, we noticed issues with hermes on iOS in the template projects
These changes create a subspec to the react-core pod so that it can access hermes header correctly.

## Changelog

Not applicable

Pull Request resolved: #31559

Test Plan: I've ran e2e manual test. Tested RNTester manually also. Then tested a project inited with hermes and the default template

Reviewed By: mhorowitz

Differential Revision: D28564642

Pulled By: Huxpro

fbshipit-source-id: cfcb3363254f62a0e514ec99159b32f841ee4463
  • Loading branch information
Titozzz authored and facebook-github-bot committed May 20, 2021
1 parent b161241 commit 59abb5f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion React-Core.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Pod::Spec.new do |s|
s.header_dir = "React"
s.framework = "JavaScriptCore"
s.library = "stdc++"
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/RCT-Folly\"", "DEFINES_MODULE" => "YES" }
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-hermes\" \"${PODS_ROOT}/Headers/Public/hermes-engine\"", "DEFINES_MODULE" => "YES" }
s.user_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/Headers/Private/React-Core\""}
s.default_subspec = "Default"

Expand Down
4 changes: 2 additions & 2 deletions React/CxxBridge/RCTCxxBridge.mm
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@
#import <reactperflogger/BridgeNativeModulePerfLogger.h>

#ifndef RCT_USE_HERMES
#if __has_include(<hermes/hermes.h>)
#if __has_include(<reacthermes/HermesExecutorFactory.h>)
#define RCT_USE_HERMES 1
#else
#define RCT_USE_HERMES 0
#endif
#endif

#if RCT_USE_HERMES
#import <reacthermes/HermesExecutorFactory.h">
#import <reacthermes/HermesExecutorFactory.h>
#else
#import "JSCExecutorFactory.h"
#endif
Expand Down
2 changes: 1 addition & 1 deletion packages/rn-tester/RNTester/AppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#import "AppDelegate.h"

#ifndef RCT_USE_HERMES
#if __has_include(<hermes/hermes.h>)
#if __has_include(<reacthermes/HermesExecutorFactory.h>)
#define RCT_USE_HERMES 1
#else
#define RCT_USE_HERMES 0
Expand Down

0 comments on commit 59abb5f

Please sign in to comment.