-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathRakefile
More file actions
76 lines (66 loc) · 2.38 KB
/
Rakefile
File metadata and controls
76 lines (66 loc) · 2.38 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
namespace :openssl do
namespace :ios do
task :config do
$project = "openssl.xcodeproj"
$target = "crypto"
$config = "Release"
$sdks = %w(iphonesimulator iphoneos)
$output_lib = 'build/ios-libs'
end
task build: :config do
$sdks.each do |sdk|
sh "xcodebuild -project #{$project} -configuration #{$config} -sdk #{sdk} -target #{$target} TARGET_BUILD_DIR=../build/#{$config}-#{sdk} BUILD_PRODUCTS_DIR=../build/#{$config}-#{sdk} clean build"
end
end
task combine: :config do
Dir.mkdir($output_lib) if !Dir.exist?($output_lib)
Dir.glob("build/#{$config}-#{$sdks.first}/libcrypto.a") do |path|
libfile = File.basename(path)
libs = $sdks.map{ |s| "'build/#{$config}-#{s}/#{libfile}'" }.join(" ")
sh "lipo #{libs} -create -output '#{$output_lib}/#{libfile}'"
end
end
task :all do
Rake::Task['openssl:ios:build'].invoke
Rake::Task['openssl:ios:combine'].invoke
end
end
end
namespace :sqlcipher do
namespace :ios do
task :config do
$project = "sqlcipher/sqlcipher.xcodeproj"
$target = "sqlcipher"
$config = "Release"
$sdks = %w(iphonesimulator iphoneos)
$output_lib = 'build/ios-libs'
end
task build: :config do
# prepare sqlite3.c
sh 'cd sqlcipher && make clean && ./configure --enable-tempstore=yes --with-crypto-lib=commoncrypto CFLAGS="-DSQLITE_HAS_CODEC -DSQLITE_TEMP_STORE=2" && make sqlite3.c'
$sdks.each do |sdk|
sh "xcodebuild -project #{$project} -configuration #{$config} -sdk #{sdk} -target #{$target} TARGET_BUILD_DIR=../build/#{$config}-#{sdk} BUILD_PRODUCTS_DIR=../build/#{$config}-#{sdk} clean build"
end
# clean build directory
sh "rm -fr sqlcipher/build"
end
task combine: :config do
Dir.mkdir($output_lib) if !Dir.exist?($output_lib)
Dir.glob("build/#{$config}-#{$sdks.first}/libsqlcipher.a") do |path|
libfile = File.basename(path)
libs = $sdks.map{ |s| "'build/#{$config}-#{s}/#{libfile}'" }.join(" ")
sh "lipo #{libs} -create -output '#{$output_lib}/#{libfile}'"
end
end
task :all do
Rake::Task['sqlcipher:ios:build'].invoke
Rake::Task['sqlcipher:ios:combine'].invoke
end
end
end
namespace :build do
namespace :ios do
Rake::Task['openssl:ios:all'].invoke
Rake::Taks['sqlcipher:ios:all'].invoke
end
end