How to set SQLITE_HAS_CODEC from a project which includes FMDB as submodule

212 views
Skip to first unread message

Ullas Lakshminarayan

unread,
Jun 28, 2016, 1:29:34 PM6/28/16
to FMDB, Dipta Rakshit

I am using FMDB as a submodule. I Also need the database encryption. Going by the implementation file


- (BOOL)setKeyWithData:(NSData *)keyData {

#ifdef SQLITE_HAS_CODEC

    if (!keyData) {

        return NO;

    }

    

    int rc = sqlite3_key(_db, [keyData bytes], (int)[keyData length]);

    

    return (rc == SQLITE_OK);

#else

    return NO;

#endif

}


Encryption/Decrytion requires following settings


1.Build Settings -> Preprocessor Macros-> SQLITE_HAS_CODEC=1

2.Build Settings -> "Other C Flags" —>DSQLITE_HAS_CODEC


Although setting this value in my project which contains FMDB as submodule, doesn’t have any effect i.e. key is not set.


However if this settings is changed in FMDB project which is a submodule , everything is all right.


How can i override SQLITE_HAS_CODEC from the original project which include FMDB as submodule


Reply all
Reply to author
Forward
0 new messages