diff --git a/ReactCommon/hermes/React-hermes.podspec b/ReactCommon/hermes/React-hermes.podspec index d08e5b68a7cab7..83d64d3a81978f 100644 --- a/ReactCommon/hermes/React-hermes.podspec +++ b/ReactCommon/hermes/React-hermes.podspec @@ -5,6 +5,10 @@ require "json" +# Whether Hermes is built for Release or Debug is determined by the PRODUCTION envvar. +build_type = ENV['PRODUCTION'] == "1" ? :release : :debug + +# package.json package = JSON.parse(File.read(File.join(__dir__, "..", "..", "package.json"))) version = package['version'] @@ -25,7 +29,7 @@ Pod::Spec.new do |s| s.version = version s.summary = "-" # TODO s.homepage = "https://reactnative.dev/" - s.license = package["license"] + s.license = package['license'] s.author = "Facebook, Inc. and its affiliates" s.platforms = { :osx => "10.14", :ios => "12.4" } s.source = source @@ -36,9 +40,8 @@ Pod::Spec.new do |s| s.public_header_files = "executor/HermesExecutorFactory.h" s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags s.pod_target_xcconfig = { - "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/..\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/libevent/include\"", - "GCC_PREPROCESSOR_DEFINITIONS" => "HERMES_ENABLE_DEBUGGER=1", - } + "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/..\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/libevent/include\"" + }.merge!(build_type == :debug ? { "GCC_PREPROCESSOR_DEFINITIONS" => "HERMES_ENABLE_DEBUGGER=1" } : {}) s.header_dir = "reacthermes" s.dependency "React-cxxreact", version s.dependency "React-jsi", version diff --git a/sdks/hermes-engine/hermes-engine.podspec b/sdks/hermes-engine/hermes-engine.podspec index 68014a97f88b2b..fd108231491024 100644 --- a/sdks/hermes-engine/hermes-engine.podspec +++ b/sdks/hermes-engine/hermes-engine.podspec @@ -11,8 +11,7 @@ react_native_path = File.join(__dir__, "..", "..") build_type = ENV['PRODUCTION'] == "1" ? :release : :debug # package.json -package_file = File.join(react_native_path, "package.json") -package = JSON.parse(File.read(package_file)) +package = JSON.parse(File.read(File.join(react_native_path, "package.json"))) version = package['version'] # sdks/.hermesversion @@ -59,11 +58,10 @@ Pod::Spec.new do |spec| spec.ios.vendored_frameworks = "destroot/Library/Frameworks/universal/hermes.xcframework" spec.osx.vendored_frameworks = "destroot/Library/Frameworks/macosx/hermes.framework" - spec.xcconfig = { - "CLANG_CXX_LANGUAGE_STANDARD" => "c++17", - "CLANG_CXX_LIBRARY" => "compiler-default", - "GCC_PREPROCESSOR_DEFINITIONS" => "HERMES_ENABLE_DEBUGGER=#{build_type == :debug ? "1" : "0"}" - } + spec.xcconfig = { + "CLANG_CXX_LANGUAGE_STANDARD" => "c++17", + "CLANG_CXX_LIBRARY" => "compiler-default" + }.merge!(build_type == :debug ? { "GCC_PREPROCESSOR_DEFINITIONS" => "HERMES_ENABLE_DEBUGGER=1" } : {}) if source[:git] then ENV['REACT_NATIVE_PATH'] = react_native_path