From 0f0f1fbb072e2928f9fe88d8975ff77e3393c99e Mon Sep 17 00:00:00 2001 From: Marc Rousavy Date: Mon, 28 Jun 2021 18:27:03 +0200 Subject: [PATCH] fix: React Native 0.65 compatibility (#230) * Update Hermes Header import for RN 0.65 * Update VisionCamera.podspec --- VisionCamera.podspec | 2 +- cpp/MakeJSIRuntime.h | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/VisionCamera.podspec b/VisionCamera.podspec index 2271731..8cfe1c6 100644 --- a/VisionCamera.podspec +++ b/VisionCamera.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| s.pod_target_xcconfig = { "DEFINES_MODULE" => "YES", "USE_HEADERMAP" => "YES", - "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/Headers/Private/React-Core\" " + "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/Headers/Private/React-Core\" \"$(PODS_ROOT)/Headers/Public/React-hermes\" \"$(PODS_ROOT)/Headers/Public/hermes-engine\"" } s.requires_arc = true diff --git a/cpp/MakeJSIRuntime.h b/cpp/MakeJSIRuntime.h index daed15e..1a392f2 100644 --- a/cpp/MakeJSIRuntime.h +++ b/cpp/MakeJSIRuntime.h @@ -19,7 +19,10 @@ // on iOS, we simply check by __has_include. Headers are only available if the sources are there too. -#if __has_include() +#if __has_include() +// Hermes (https://hermesengine.dev) (RN 0.65+) +#include +#elif __has_include() // Hermes (https://hermesengine.dev) #include #elif __has_include() @@ -47,7 +50,7 @@ static std::unique_ptr makeJSIRuntime() { #else - #if __has_include() + #if __has_include() || __has_include() return facebook::hermes::makeHermesRuntime(); #elif __has_include() return facebook::createV8Runtime("");