Jelajahi Sumber

Merge pull request #179 from snooc/podspec-dsqlite

Compilation Issue when using CocoaPods + SQLCipher
August "Gus" Mueller 12 tahun lalu
induk
melakukan
185509b757
2 mengubah file dengan 21 tambahan dan 0 penghapusan
  1. 11 0
      README.markdown
  2. 10 0
      fmdb.podspec

+ 11 - 0
README.markdown

@@ -9,6 +9,17 @@ http://www.sqlite.org/faq.html
 
 Since FMDB is built on top of SQLite, you're going to want to read this page top to bottom at least once.  And while you're there, make sure to bookmark the SQLite Documentation page: http://www.sqlite.org/docs.html
 
+## CocoaPods
+
+FMDB can be installed using [CocoaPods](http://cocoapods.org/).
+
+```
+pod 'FMDB'
+# pod 'FMDB/SQLCipher'   # If using FMDB with SQLCipher
+```
+
+**If using FMDB with [SQLCipher](http://sqlcipher.net/) you must use the FMDB/SQLCipher subspec. The FMDB/SQLCipher subspec declares SQLCipher as a dependency, allowing FMDB to be compiled with the `-DSQLITE_HAS_CODEC` flag.**
+
 ## FMDB Class Reference:
 http://ccgus.github.io/fmdb/html/index.html
 

+ 10 - 0
fmdb.podspec

@@ -10,4 +10,14 @@ Pod::Spec.new do |s|
   s.source_files = 'src/FM*.{h,m}'
   s.exclude_files = 'src/fmdb\.m'
   s.library = 'sqlite3'
+
+  s.subspec 'SQLCipher' do |ss|
+    ss.source_files = 'src/FM*.{h,m}'
+    ss.exclude_files = 'src/fmdb\.m'
+    ss.library = 'sqlite3'
+
+    ss.xcconfig     =  { 'OTHER_CFLAGS' => '$(inherited) -DSQLITE_HAS_CODEC' }
+
+    ss.dependency 'SQLCipher'
+  end
 end