Repository navigation
Expand file tree
/
Copy pathCodepad.podspec
More file actions
55 lines (48 loc) · 2.21 KB
/
Copy pathCodepad.podspec
File metadata and controls
55 lines (48 loc) · 2.21 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
require "json"
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
Pod::Spec.new do |s|
s.name = "Codepad"
s.version = package["version"]
s.summary = package["description"]
s.homepage = package["homepage"]
s.license = package["license"]
s.authors = package["author"]
s.platforms = { :ios => "17.0" }
s.swift_version = "6.0"
s.source = { :git => "https://github.com/SectionTN/react-native-codepad.git", :tag => "#{s.version}" }
s.source_files = [
"ios/**/*.{swift}",
"ios/**/*.{h,m,mm}",
"cpp/tree-sitter/lib/include/tree_sitter/api.h",
]
# The runtime compiles at -O2 whatever the app's configuration, as the Android CMake build does: at the
# Debug -O0 the query cursor walk behind every keystroke runs four times slower.
s.subspec "TreeSitter" do |ss|
ss.source_files = "cpp/tree-sitter/lib/src/lib.c"
ss.compiler_flags = "-O2"
end
# The shared core and its regex engine, at -O2 for the same reason.
s.subspec "Core" do |ss|
ss.source_files = ["cpp/core/src/*.{hpp,cpp}", "cpp/core/include/codepad.h", "cpp/pcre2/src/*.{c,h}"]
ss.private_header_files = ["cpp/core/src/*.hpp", "cpp/pcre2/src/*.h"]
ss.compiler_flags = "-O2 -DPCRE2_CODE_UNIT_WIDTH=16 -DHAVE_CONFIG_H"
end
# The pod's Swift reads the tree-sitter API through CPTreeSitter.h in the umbrella header; api.h ships
# beside it because the public headers directory is flat.
s.public_header_files = [
"ios/Codepad/syntax/CPTreeSitter.h",
"ios/Codepad/syntax/CPCore.h",
"cpp/tree-sitter/lib/include/tree_sitter/api.h",
"cpp/core/include/codepad.h",
]
s.preserve_paths = ["cpp/tree-sitter/lib/**/*", "cpp/core/**/*", "cpp/pcre2/**/*"]
s.pod_target_xcconfig = {
"HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/cpp/tree-sitter/lib/include\" \"$(PODS_TARGET_SRCROOT)/cpp/tree-sitter/lib/src\" \"$(PODS_TARGET_SRCROOT)/cpp/core/include\" \"$(PODS_TARGET_SRCROOT)/cpp/pcre2/src\"",
"GCC_PREPROCESSOR_DEFINITIONS" => "$(inherited) TREE_SITTER_HIDE_SYMBOLS=1",
}
s.dependency 'React-jsi'
s.dependency 'React-callinvoker'
load 'nitrogen/generated/ios/Codepad+autolinking.rb'
add_nitrogen_files(s)
install_modules_dependencies(s)
end