@ -38,15 +38,7 @@ Session requires a number of submodules to build, these can be retrieved by navi
git submodule update --init --recursive
```
## 3. Pods
To build and configure the libraries Session uses, just run:
```
pod install
```
## 4. libSession build dependencies
## 3. libSession build dependencies
The iOS project has a share C++ library called `libSession` which is built as one of the project dependencies, in order for this to compile the following dependencies need to be installed:
- cmake
@ -59,12 +51,12 @@ Additionally `xcode-select` needs to be setup correctly (depending on the order
It seems that there is an open issue with Swift Package Manager (https://github.com/swiftlang/swift-package-manager/issues/4407) where some packages (in our case `libwebp`) run into issues when the Address Sanitizer or Undefined Behaviour Sanitizer are enabled within the scheme, if you see linker errors like the below when building this is likely the issue and can be resolved by disabling these sanitisers.
In order to still benefit from these settings they are explicitly set as `Other C Flags` for the `SessionUtil` target when building in debug mode to enable better debugging of `libSession`.
```
Undefined symbol: ___asan_init
Undefined symbol: ___ubsan_handle_add_overflow
```
### Third-party Installation
The database for the app is stored within an `App Group` directory which is based on the app identifier, unfortunately the identifier cannot be retrieved at runtime so it's currently hard-coded in the code. In order to be able to run session on a device you will need to update the `UserDefaults.applicationGroup` variable in `SessionUtilitiesKit/General/SNUserDefaults` to match the value provided (You may also need to create the `App Group` on your Apple Developer account).
# Dependencies to be included in the app and all extensions/frameworks
abstract_target 'GlobalDependencies' do
# FIXME: If https://github.com/jedisct1/swift-sodium/pull/249 gets resolved then revert this back to the standard pod
pod 'Sodium', :git => 'https://github.com/oxen-io/session-ios-swift-sodium.git', commit: '310c343'
pod 'GRDB.swift/SQLCipher'
# FIXME: Would be nice to migrate from CocoaPods to SwiftPackageManager (should allow us to speed up build time), haven't gone through all of the dependencies but currently unfortunately SQLCipher doesn't support SPM (for more info see: https://github.com/sqlcipher/sqlcipher/issues/371)
pod 'SQLCipher', '~> 4.5.7'
pod 'WebRTC-lib'
target 'Session' do
pod 'PureLayout', '~> 3.1.8'
pod 'NVActivityIndicatorView'
pod 'YYImage/libwebp', git: 'https://github.com/signalapp/YYImage'
pod 'DifferenceKit'
target 'SessionTests' do
inherit! :complete
pod 'Quick'
pod 'Nimble'
end
end
# Dependencies to be included only in all extensions/frameworks
abstract_target 'FrameworkAndExtensionDependencies' do
pod 'Curve25519Kit', git: 'https://github.com/oxen-io/session-ios-curve-25519-kit.git', branch: 'session-version'
pod 'SignalCoreKit', git: 'https://github.com/oxen-io/session-ios-core-kit', :commit => '3acbfe5'
target 'SessionNotificationServiceExtension'
# Dependencies that are shared across a number of extensions/frameworks but not all
abstract_target 'ExtendedDependencies' do
pod 'PureLayout', '~> 3.1.8'
target 'SessionShareExtension' do
pod 'NVActivityIndicatorView'
pod 'DifferenceKit'
end
target 'SignalUtilitiesKit' do
pod 'NVActivityIndicatorView'
pod 'SAMKeychain'
pod 'SwiftProtobuf', '~> 1.5.0'
pod 'YYImage/libwebp', git: 'https://github.com/signalapp/YYImage'
pod 'DifferenceKit'
end
target 'SessionMessagingKit' do
pod 'SAMKeychain'
pod 'SwiftProtobuf', '~> 1.5.0'
pod 'DifferenceKit'
target 'SessionMessagingKitTests' do
inherit! :complete
pod 'Quick'
pod 'Nimble'
# Need to include this for the tests because otherwise it won't actually build
pod 'YYImage/libwebp', git: 'https://github.com/signalapp/YYImage'
end
end
target 'SessionUtilitiesKit' do
pod 'SAMKeychain'
pod 'YYImage/libwebp', git: 'https://github.com/signalapp/YYImage'
pod 'DifferenceKit'
target 'SessionUtilitiesKitTests' do
inherit! :complete
pod 'Quick'
pod 'Nimble'
end
end
end
target 'SessionSnodeKit' do
target 'SessionSnodeKitTests' do
inherit! :complete
pod 'Quick'
pod 'Nimble'
# Need to include these for the tests because otherwise it won't actually build
pod 'SAMKeychain'
pod 'PureLayout', '~> 3.1.8'
pod 'YYImage/libwebp', git: 'https://github.com/signalapp/YYImage'
pod 'DifferenceKit'
end
end
end
target 'SessionUIKit' do
pod 'GRDB.swift/SQLCipher'
pod 'DifferenceKit'
pod 'YYImage/libwebp', git: 'https://github.com/signalapp/YYImage'
end
end
# Actions to perform post-install
post_install do |installer|
set_minimum_deployment_target(installer)
end
def set_minimum_deployment_target(installer)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |build_configuration|