Swift project support

Merge patch required to support Swift projects, from Avery Pierce.

Patch taken from https://github.com/matrix-org/matrix-ios-sdk/files/712987/olm_patch.txt.

Sign-off at https://github.com/matrix-org/matrix-ios-sdk/pull/220#issue-201470911.
This commit is contained in:
Richard van der Hoff 2017-01-18 10:46:59 +00:00
commit 1761730db8
3 changed files with 15 additions and 7 deletions

View file

@ -32,6 +32,7 @@ Pod::Spec.new do |s|
}
s.source_files = "xcode/OLMKit/*.{h,m}", "include/**/*.{h,hh}", "src/*.{c,cpp}", "lib/crypto-algorithms/sha256.c", "lib/crypto-algorithms/aes.c", "lib/curve25519-donna/curve25519-donna.c"
s.private_header_files = "xcode/OLMKit/*_Private.h"
# Those files (including .c) are included by ed25519.c. We do not want to compile them twice
s.preserve_paths = "lib/ed25519/**/*.{h,c}"

View file

@ -18,10 +18,6 @@
#import <Foundation/Foundation.h>
//! Project version string for OLMKit, the same as libolm.
NSString *OLMKitVersionString();
// In this header, you should import all the public headers of your framework using statements like #import <OLMKit/PublicHeader.h>
#import <OLMKit/OLMAccount.h>
@ -30,3 +26,10 @@ NSString *OLMKitVersionString();
#import <OLMKit/OLMUtility.h>
#import <OLMKit/OLMInboundGroupSession.h>
#import <OLMKit/OLMOutboundGroupSession.h>
@interface OLMKit : NSObject
//! Project version string for OLMKit, the same as libolm.
+ (NSString*)versionString;
@end

View file

@ -19,7 +19,9 @@
#include "olm/olm.h"
NSString *OLMKitVersionString()
@implementation OLMKit
+ (NSString*)versionString
{
uint8_t major, minor, patch;
@ -27,3 +29,5 @@ NSString *OLMKitVersionString()
return [NSString stringWithFormat:@"%tu.%tu.%tu", major, minor, patch];
}
@end