forked from mrousavy/nitro
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNitroModules.podspec
More file actions
91 lines (83 loc) · 2.98 KB
/
NitroModules.podspec
File metadata and controls
91 lines (83 loc) · 2.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
require "json"
require "./nitro_pod_utils"
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
Pod::UI.puts "[NitroModules] 🔥 Your app is boosted by nitro modules!"
Pod::Spec.new do |s|
s.name = "NitroModules"
s.version = package["version"]
s.summary = package["description"]
s.homepage = package["homepage"]
s.license = package["license"]
s.authors = package["author"]
s.source = { :git => "https://github.com/mrousavy/nitro.git", :tag => "#{s.version}" }
s.platforms = {
:ios => min_ios_version_supported,
:visionos => 1.0,
:macos => 10.13,
:tvos => 13.4,
}
s.source_files = [
# Shared C++ codebase
"cpp/**/*.{h,hpp}",
"cpp/**/*.{c,cpp}",
# iOS codebase
"ios/**/*.{h,hpp}",
"ios/**/*.{c,cpp}",
"ios/**/*.{m,mm}",
"ios/**/*.swift",
]
s.public_header_files = [
# Public C++ headers will be exposed in modulemap (for Swift)
"cpp/core/AnyMap.hpp",
"cpp/core/ArrayBuffer.hpp",
"cpp/core/HybridObject.hpp",
"cpp/core/Null.hpp",
"cpp/core/Promise.hpp",
"cpp/entrypoint/HybridNitroModulesProxy.hpp",
"cpp/entrypoint/InstallNitro.hpp",
"cpp/registry/HybridObjectRegistry.hpp",
"cpp/jsi/JSIConverter.hpp",
"cpp/jsi/JSIHelpers.hpp",
"cpp/platform/NitroLogger.hpp",
"cpp/threading/Dispatcher.hpp",
"cpp/utils/JSCallback.hpp",
"cpp/utils/FastVectorCopy.hpp",
"cpp/utils/NitroHash.hpp",
"cpp/utils/NitroDefines.hpp",
"cpp/utils/PropNameIDCache.hpp",
"cpp/views/CachedProp.hpp",
# Public iOS-specific headers that will be exposed in modulemap (for Swift)
"ios/core/ArrayBufferHolder.hpp",
"ios/core/PromiseHolder.hpp",
"ios/utils/AnyMapUtils.hpp",
"ios/utils/AnyMapHolder.hpp", # <-- deprecated, removed soon
"ios/utils/Result.hpp",
"ios/utils/DateToChronoDate.hpp",
"ios/utils/RuntimeError.hpp",
"ios/utils/SwiftClosure.hpp",
]
xcconfig = {
# Use C++ 20
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
# Enables C++ <-> Swift interop (by default its only ObjC)
"SWIFT_OBJC_INTEROP_MODE" => "objcxx",
# Enables stricter modular headers
"DEFINES_MODULE" => "YES",
}
if has_react_native()
react_native_version = get_react_native_version()
if (react_native_version < 80)
# C++ compiler flags, for folly when building as static framework:
current_header_search_paths = Array(xcconfig["HEADER_SEARCH_PATHS"])
xcconfig["HEADER_SEARCH_PATHS"] = current_header_search_paths + ["${PODS_ROOT}/RCT-Folly"]
xcconfig["GCC_PREPROCESSOR_DEFINITIONS"] = "$(inherited) FOLLY_NO_CONFIG FOLLY_CFG_NO_COROUTINES"
xcconfig["OTHER_CPLUSPLUSFLAGS"] = "$(inherited) -DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1"
end
end
s.pod_target_xcconfig = xcconfig
# Nitro depends on JSI.
s.dependency 'React-jsi'
# For React Native, we implement nitro::Dispatcher using react::CallInvoker
s.dependency 'React-callinvoker'
install_modules_dependencies(s)
end