Skip to content

Commit

Permalink
Moves _SQLITE3_H_=1 _FTS5_H=1 _SQLITE3RTREE_H_=1 for podspec to user_…
Browse files Browse the repository at this point in the history
…target_xcconfig as we only want that applied to the consuming project.
  • Loading branch information
R4N committed Apr 24, 2024
1 parent 2d6941f commit 832e658
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion SQLCipher.podspec.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,11 @@
"resource_bundles": {"SQLCipher": ["sqlcipher-resources/PrivacyInfo.xcprivacy"]},
"xcconfig": {
"HEADER_SEARCH_PATHS": "$(PODS_ROOT)/SQLCipher",
"GCC_PREPROCESSOR_DEFINITIONS": "$(inherited) SQLITE_HAS_CODEC=1 _SQLITE3_H_=1 _FTS5_H=1 _SQLITE3RTREE_H_=1",
"GCC_PREPROCESSOR_DEFINITIONS": "SQLITE_HAS_CODEC=1",
"OTHER_CFLAGS": "$(inherited) -DSQLITE_HAS_CODEC -DSQLITE_TEMP_STORE=2 -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_STAT3 -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_LOAD_EXTENSION -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS4_UNICODE61 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLCIPHER_CRYPTO_CC -DHAVE_USLEEP=1 -DSQLITE_MAX_VARIABLE_NUMBER=99999"
},
"user_target_xcconfig": {
"GCC_PREPROCESSOR_DEFINITIONS": "_SQLITE3_H_=1 _FTS5_H=1 _SQLITE3RTREE_H_=1"
}
},
{
Expand Down

5 comments on commit 832e658

@manahilov
Copy link

Choose a reason for hiding this comment

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

Hi @R4N, When I updated to 4.5.7 I am not able to build. I have the following errors

Unknown type name 'sqlite3_rtree_geometry'
Unknown type name 'sqlite3_rtree_query_info'
Use of undeclared identifier 'pInfo'

and many more.
I see in the .c file that in Xcode the definitions are greyed out because of the

#ifndef _SQLITE3RTREE_H_
#define _SQLITE3RTREE_H_

Screenshot 2024-04-25 at 11 15 32
Screenshot 2024-04-25 at 11 15 22
Screenshot 2024-04-25 at 11 15 04
sqlcipher-errors

Any advice how to fix that?

@R4N
Copy link
Member Author

@R4N R4N commented on 832e658 Apr 25, 2024

Choose a reason for hiding this comment

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

@manahilov

I'm unable to reproduce this when integrating SQLCipher 4.5.7 via Cocoapods. A few questions:

  • Which language/interface combination are you using? Objective-C, Swift, Swift/SwiftUI?
  • What does your Podfile look like?
  • Are you able to reproduce the issue in a fresh project with just standalone SQLCipher pod?
  • Are you including an sqlite3.c/sqlite3.h source files in your top level project?

@manahilov
Copy link

Choose a reason for hiding this comment

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

Thank you for the prompt response @R4N ,

I am not able to share the Podfile, but we are using https://github.com/stephencelis/SQLite.swift v0.15.3 as SQLite.swift/SQLCipher and our GCC_PREPROCESSOR_DEFINITIONS looks like this after SQLCipher update to 4.5.7

GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 $(inherited) SQLITE_HAS_CODEC=1 GRDBCIPHER=1 SQLITE_ENABLE_FTS5=1 $(inherited) SQLITE_HAS_CODEC=1 _SQLITE3_H_=1 _FTS5_H=1 _SQLITE3RTREE_H_=1 $(inherited) SQLITE_HAS_CODEC=1 SQLITE_SWIFT_SQLCIPHER=1 $(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1

Thanks.

@R4N
Copy link
Member Author

@R4N R4N commented on 832e658 Apr 25, 2024

Choose a reason for hiding this comment

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

@manahilov

The SQLite.swift/SQLCipher subspec works fine for me with the latest SQLCipher 4.5.7 release.

It looks like you additionally have preprocessor macros defined for GRDB, are you also including the GRDB.swift/SQLCipher subspec?

I also tried the GRDB.swift/SQLCipher subspec and that works properly with the SQLCipher 4.5.7 release.

I suspect your Podfile has both included i.e.

pod 'SQLite.swift/SQLCipher'
pod 'GRDB.swift/SQLCipher'

This type of configuration would include two SQLCipher transitive dependencies which can lead to undefined/undesired behavior. You'll need to stick to one wrapper.

@manahilov
Copy link

Choose a reason for hiding this comment

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

Yes we include GRDB.swift/SQLCipher as well. Thank you for pointing directions to look for, I will check them.

Please sign in to comment.