mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: This PR makes it possible to build iOS applications with Hermes. Note that it doesn't work with `use_frameworks!` just yet. Fixes https://github.com/facebook/react-native/issues/27845 (by downgrading iOS deployment target for RCT-Folly to 9.0) Fixes https://github.com/facebook/react-native/issues/28810 (as above) Checklist: - [x] Adjust release scripts to create Hermes bytecode bundle - [x] Release new Hermes npm package that includes iOS files (unreleased right now, if you want to try locally, you have to clone Hermes and `yarn link` its master to this project) - [x] Test on a new React Native application in both Debug and Release (Device) - [x] Test on an RNTester application in both Debug and Release (Device) - [x] Add missing `i386` to Hermes framework and enable Bitcode - [x] Inspect CI failures for possible regressions - [x] Resolve Folly issue as reported https://github.com/facebook/react-native/issues/27845 and https://github.com/facebook/react-native/issues/28810 - [x] Release new Hermes and test against it that everything works ## Changelog [IOS] [FEATURE] - Enable Hermes on iOS [INTERNAL] - Upgrade to CocoaPods 1.10.0 to resolve Xcode 12.0 issues [INTERNAL] - Upgrade to Xcode 12.0 on the CircleCI [INTERNAL] - Fix building RNTester in Release mode [INTERNAL] - Fix build-time errors of `libevent` with `use_frameworks!` [INTERNAL] - Introduce `USE_HERMES` variable and test all RNTester configurations on the CI [INTERNAL] - Do not fetch CocoaPods repository since we're using CDN anyway Pull Request resolved: https://github.com/facebook/react-native/pull/29914 Test Plan: Turn on `hermes_enabled` to true in your `Podfile`, install pods, and run the iOS application. Your app should be running Hermes now. Preview: (note "Engine: Hermes") <img width="395" alt="Screenshot 2020-09-09 at 19 22 32" src="https://user-images.githubusercontent.com/2464966/92631584-d7c01d80-f2d1-11ea-9b40-33d73db96a53.png"> Reviewed By: hramos Differential Revision: D24684845 Pulled By: cpojer fbshipit-source-id: 900cbe3bf9398a6fd4a773d552899a001bf5146b
130 lines
7.3 KiB
Ruby
130 lines
7.3 KiB
Ruby
# Copyright (c) Facebook, Inc. and its affiliates.
|
|
#
|
|
# This source code is licensed under the MIT license found in the
|
|
# LICENSE file in the root directory of this source tree.
|
|
|
|
Pod::Spec.new do |spec|
|
|
spec.name = 'RCT-Folly'
|
|
spec.version = '2020.01.13.00'
|
|
spec.license = { :type => 'Apache License, Version 2.0' }
|
|
spec.homepage = 'https://github.com/facebook/folly'
|
|
spec.summary = 'An open-source C++ library developed and used at Facebook.'
|
|
spec.authors = 'Facebook'
|
|
spec.source = { :git => 'https://github.com/facebook/folly.git',
|
|
:tag => "v#{spec.version}" }
|
|
spec.module_name = 'folly'
|
|
spec.header_mappings_dir = '.'
|
|
spec.dependency 'boost-for-react-native'
|
|
spec.dependency 'DoubleConversion'
|
|
spec.dependency 'glog'
|
|
spec.compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_HAVE_PTHREAD=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-documentation'
|
|
spec.source_files = 'folly/String.cpp',
|
|
'folly/Conv.cpp',
|
|
'folly/Demangle.cpp',
|
|
'folly/FileUtil.cpp',
|
|
'folly/Format.cpp',
|
|
'folly/lang/SafeAssert.cpp',
|
|
'folly/ScopeGuard.cpp',
|
|
'folly/Unicode.cpp',
|
|
'folly/dynamic.cpp',
|
|
'folly/json.cpp',
|
|
'folly/json_pointer.cpp',
|
|
'folly/container/detail/F14Table.cpp',
|
|
'folly/detail/Demangle.cpp',
|
|
'folly/detail/UniqueInstance.cpp',
|
|
'folly/hash/SpookyHashV2.cpp',
|
|
'folly/lang/Assume.cpp',
|
|
'folly/lang/CString.cpp',
|
|
'folly/memory/detail/MallocImpl.cpp',
|
|
'folly/net/NetOps.cpp',
|
|
'folly/portability/SysUio.cpp',
|
|
'folly/*.h',
|
|
'folly/container/*.h',
|
|
'folly/container/detail/*.h',
|
|
'folly/detail/*.h',
|
|
'folly/functional/*.h',
|
|
'folly/hash/*.h',
|
|
'folly/lang/*.h',
|
|
'folly/memory/*.h',
|
|
'folly/memory/detail/*.h',
|
|
'folly/net/*.h',
|
|
'folly/net/detail/*.h',
|
|
'folly/portability/*.h'
|
|
|
|
# workaround for https://github.com/facebook/react-native/issues/14326
|
|
spec.preserve_paths = 'folly/*.h',
|
|
'folly/container/*.h',
|
|
'folly/container/detail/*.h',
|
|
'folly/detail/*.h',
|
|
'folly/functional/*.h',
|
|
'folly/hash/*.h',
|
|
'folly/lang/*.h',
|
|
'folly/memory/*.h',
|
|
'folly/memory/detail/*.h',
|
|
'folly/net/*.h',
|
|
'folly/net/detail/*.h',
|
|
'folly/portability/*.h'
|
|
spec.libraries = "stdc++"
|
|
spec.pod_target_xcconfig = { "USE_HEADERMAP" => "NO",
|
|
"CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
|
|
"HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/libevent/include/\"" }
|
|
|
|
# TODO: The boost spec should really be selecting these files so that dependents of Folly can also access the required headers.
|
|
spec.user_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost-for-react-native\"" }
|
|
|
|
spec.default_subspec = 'Default'
|
|
|
|
spec.subspec 'Default' do
|
|
# no-op
|
|
end
|
|
|
|
spec.subspec 'Fabric' do |fabric|
|
|
fabric.source_files = 'folly/SharedMutex.cpp',
|
|
'folly/concurrency/CacheLocality.cpp',
|
|
'folly/detail/Futex.cpp',
|
|
'folly/synchronization/ParkingLot.cpp',
|
|
'folly/portability/Malloc.cpp'
|
|
fabric.preserve_paths = 'folly/concurrency/CacheLocality.h',
|
|
'folly/synchronization/ParkingLot.h',
|
|
'folly/synchronization/SanitizeThread.h',
|
|
'folly/system/ThreadId.h'
|
|
end
|
|
|
|
spec.subspec 'Futures' do |futures|
|
|
futures.dependency 'libevent'
|
|
futures.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => ["$(inherited)", "$(PODS_ROOT)/Headers/Public/libevent/event"] }
|
|
futures.source_files = 'folly/futures/*.{h,cpp}',
|
|
'folly/futures/detail/*.{h,cpp}',
|
|
'folly/executors/*.{h,cpp}',
|
|
'folly/executors/thread_factory/{NamedThreadFactory,ThreadFactory}.{h,cpp}',
|
|
'folly/executors/task_queue/{BlockingQueue,UnboundedBlockingQueue,LifoSemMPMCQueue,PriorityUnboundedBlockingQueue,PriorityLifoSemMPMCQueue}.{h,cpp}',
|
|
'folly/concurrency/*.{h,cpp}',
|
|
'folly/system/{ThreadId,ThreadName,HardwareConcurrency}.{h,cpp}',
|
|
'folly/synchronization/*.{h,cpp}',
|
|
'folly/synchronization/detail/*.{h,cpp}',
|
|
'folly/experimental/{ExecutionObserver,ReadMostlySharedPtr,SingleWriterFixedHashMap,TLRefCount}.{h,cpp}',
|
|
'folly/io/async/{AsyncTimeout,DelayedDestruction,DelayedDestructionBase,EventBase,EventBaseManager,EventBaseBackendBase,EventHandler,EventUtil,HHWheelTimer,HHWheelTimer-fwd,NotificationQueue,Request,TimeoutManager,VirtualEventBase}.{h,cpp}',
|
|
'folly/io/{Cursor,Cursor-inl,IOBuf,IOBufQueue}.{h,cpp}',
|
|
'folly/tracing/StaticTracepoint.{h,cpp}',
|
|
'folly/{Executor,ExceptionWrapper,ExceptionWrapper-inl,FileUtil,Singleton,SharedMutex}.{h,cpp}',
|
|
'folly/detail/{AsyncTrace,AtFork,Futex,Futex-inl,MemoryIdler,SingletonStackTrace,StaticSingletonManager,ThreadLocalDetail}.{h,cpp}',
|
|
'folly/lang/SafeAssert.{h,cpp}',
|
|
'folly/memory/MallctlHelper.{h,cpp}',
|
|
'folly/portability/{GFlags,SysUio}.{h,cpp}',
|
|
'folly/chrono/Hardware.{h,cpp}'
|
|
# TODO: Perhaps some of the wildcards above can be further trimmed down with some of these:
|
|
#
|
|
# 'folly/executors/{DrivableExecutor,InlineExecutor,QueuedImmediateExecutor,TimedDrivableExecutor}.{h,cpp}',
|
|
# 'folly/concurrency/{CacheLocality,UnboundedQueue}.{h,cpp}',
|
|
# 'folly/system/ThreadId.h',
|
|
# 'folly/synchronization/Hazptr{,-fwd,Domain,Holder,Obj,ObjLinked,Rec,ThrLocal}.{h,cpp}',
|
|
# 'folly/synchronization/{AsymmetricMemoryBarrier,AtomicStruct,Baton,MicroSpinLock,ParkingLot,RWSpinLock,SanitizeThread,SaturatingSemaphore,WaitOptions}.{h,cpp}',
|
|
# 'folly/synchronization/detail/{AtomicUtils,Sleeper,Spin}.{h,cpp}',
|
|
# 'folly/experimental/{ReadMostlySharedPtr,TLRefCount}.h',
|
|
end
|
|
|
|
# Folly has issues when compiled with iOS 10 set as deployment target
|
|
# See https://github.com/facebook/folly/issues/1470 for details
|
|
spec.platforms = { :ios => "9.0", :tvos => "9.0" }
|
|
end
|