wcdb icon indicating copy to clipboard operation
wcdb copied to clipboard

Fix WCDB build issue for Swift user, allow CocoaPods user to use WCDB.swift without any issue

Open dreampiggy opened this issue 4 years ago • 1 comments

This PR fix many issues about current's WCDB Swift project configfuration.

  1. The pod_target_xcconfig override the OTHER_SWIFT_FLAGS, which will remove the CocoaPods's injected modulemap path, cause import error when compile Swift source files.

image

  1. The Swift code loss the symbol sqliterk_cipher_conf_set_key, which seems be the old sqliterk API. I added this one into the SQLite-Briding.h

image

  1. Fix the non framework type (For example, CocoaPods by default use Static Library without framework) build issue. I replace the <WCDBSwift/SQLite-Bridging.h> into "SQLite-Bridging.h" to make both compatible for use_frameworks! or not.

image

  1. Also, update the git submodule of sqlcipher. It seems the upstream already provided one Xcode project which can build. I just change the current swift/source/util/sqlcipher.xcodeproj reference with the symboliced sqlcipher/sqlcipher.preprocessed.xcodeproj, make it compilable by opening WCDB.swift.xcworkspace

image

After those changes above. I can easily build any Swift Demo by using the Podfile like this:

use_modular_headers!
target 'Example' do
    pod 'WCDB.swift', :git => 'https://github.com/dreampiggy/wcdb.git', :branch => 'fix_swift'
end

Provided one demo here: https://github.com/dreampiggy/WCDBSwiftDemo

Now just pod install and build just works :

image

Wait for your reply :)

dreampiggy avatar Jan 14 '21 09:01 dreampiggy

CC @RingoD @John-He-928

dreampiggy avatar Jan 14 '21 10:01 dreampiggy

New version of WCDB Swift is released, thanks.

Qiuwen-chen avatar Apr 26 '23 02:04 Qiuwen-chen