Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replacement for #401: Update podspec for SQLCipher+fts3 #503

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
59 changes: 35 additions & 24 deletions FMDB.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,54 @@ Pod::Spec.new do |s|
s.author = { 'August Mueller' => 'gus@flyingmeat.com' }
s.source = { :git => 'https://github.com/ccgus/fmdb.git', :tag => "#{s.version}" }
s.requires_arc = true
s.default_subspec = 'standard'
s.default_subspec = 'standard'

# use the built-in library version of sqlite3
s.subspec 'standard' do |ss|
ss.library = 'sqlite3'
# common: for internal use only
s.subspec 'common' do |ss|
ss.source_files = 'src/fmdb/FM*.{h,m}'
ss.exclude_files = 'src/fmdb.m'
end

# use the built-in library version of sqlite3 with custom FTS tokenizer source files
s.subspec 'FTS' do |ss|
# common_FTS: for internal use only
s.subspec 'common_FTS' do |ss|
ss.source_files = 'src/extra/fts3/*.{h,m}'
ss.dependency 'FMDB/standard'
ss.pod_target_xcconfig = { 'OTHER_CFLAGS' => '$(inherited) -DSQLITE_ENABLE_FTS4=1 -DSQLITE_ENABLE_FTS3_PARENTHESIS=1' }
end

# standard: built-in library version of sqlite3
s.subspec 'standard' do |ss|
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s.subspec 'standard' do |ss| should just have the ss.dependency 'FMDB/common' dependency instead of duplicating the source_files and exclude_files.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed - that was an oversight. Thanks for catching it.

ss.library = 'sqlite3'
ss.dependency 'FMDB/common'

# build the latest stable version of sqlite3
s.subspec 'standalone' do |ss|
ss.xcconfig = { 'OTHER_CFLAGS' => '$(inherited) -DFMDB_SQLITE_STANDALONE' }
ss.dependency 'sqlite3'
ss.source_files = 'src/fmdb/FM*.{h,m}'
ss.exclude_files = 'src/fmdb.m'
# standard/FTS: built-in library version of sqlite3 + custom FTS tokenizer source files
ss.subspec 'FTS' do |sss|
sss.dependency 'FMDB/common_FTS'
end
end

# build with FTS support and custom FTS tokenizer source files
s.subspec 'standalone-fts' do |ss|
# standalone: latest stable version of sqlite3
s.subspec 'standalone' do |ss|
ss.dependency 'sqlite3'
ss.dependency 'FMDB/common'
ss.xcconfig = { 'OTHER_CFLAGS' => '$(inherited) -DFMDB_SQLITE_STANDALONE' }
ss.source_files = 'src/fmdb/FM*.{h,m}', 'src/extra/fts3/*.{h,m}'
ss.exclude_files = 'src/fmdb.m'
ss.dependency 'sqlite3/fts'

# standalone/FTS: latest stable version of sqlite3 + FTS3 + custom FTS tokenizer source files
ss.subspec 'FTS' do |sss|
sss.dependency 'sqlite3/fts'
sss.dependency 'FMDB/common_FTS'
end
end

# use SQLCipher and enable -DSQLITE_HAS_CODEC flag
# SQLCipher: SQLCipher replaces sqlite3
s.subspec 'SQLCipher' do |ss|
ss.dependency 'SQLCipher'
ss.source_files = 'src/fmdb/FM*.{h,m}'
ss.exclude_files = 'src/fmdb.m'
ss.xcconfig = { 'OTHER_CFLAGS' => '$(inherited) -DSQLITE_HAS_CODEC -DHAVE_USLEEP=1' }
end

ss.dependency 'FMDB/common'
ss.xcconfig = { 'OTHER_CFLAGS' => '$(inherited) -DSQLITE_HAS_CODEC -DHAVE_USLEEP=1' }

# SQLCipher/FTS:, SQLCipher replaces sqlite3 + FTS3 + custom FTS tokenizer source files
ss.subspec 'FTS' do |sss|
sss.dependency 'SQLCipher/fts'
sss.dependency 'FMDB/common_FTS'
end
end
end