-
Notifications
You must be signed in to change notification settings - Fork 516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incompatibility in 3.19.0 #125
Comments
Ouch! Thanks for reporting this... I think our best option is using CMake to detect the SQLite version and set a compile flag |
Hey @tdavis, would you have some time to see if the version detection could be made through CMake ? |
there is a very easy solution: // Forward declarations to avoid inclusion of <sqlite3.h> in a header #include "sqlite3.h" |
Thanks @sorinmustaca, that is in fact totally right, but my intent was to never include "sqlite.h" in headers to avoid "header leaks" in every application using my wrapper. It compiles quicker in a big application if you avoid as much includes as possible. Until today, it was working perfectly fine. |
I don't think that there is a problem with this. Modern compilers can simply exclude the re-inclusion. And, if you look in the sqlite3.h, you see: ... So, multiple inclusions should be excluded... |
Hi, thanks for the suggestion, I think I know very well how modern compilers work (I also use #pragma once in every header of the wrapper). The problem is not with multiple inclusion of a "sqlite3.h" file: the problem is I have a 3600+ files application where I don't want those 1800 cpp files getting the inclusion to this "sqlite3.h" file. I am not willing to de-optimized anything that was carefully designed, a simple solution will not do the job for my needs. (also, I am using ccache an Unity Builds to reduce compile times) |
I will look into doing the detection in CMake and get back to ya |
So, the most straight forward way to accomplish this would be:
Then just use that name in I am happy to supply a PR for this new version, but it will take some time to clean up and also get outstanding changes into Hunter's SQLite3 package which I've also modified locally (primarily for |
No, why not using find_package() if this solves the issue, I can change my mind depending on what is best (and still simple enough) for the users |
I tried to use a FindSQLite3.cmake file but it was not portable (Windows issues) so I followed on my previous choices to only rely on a new CMake variable SQLITE_USE_LEGACY_STRUCT that the user can set to enable a SQLITE_USE_LEGACY_STRUCT compile flag (OFF by default) to use with SQLite <3.19 |
Released all the way back in yesterday, and it's still broken! ;)
SQLite 3.19.0 is incompatible with this library thanks to a minor change to the main header file (
sqlite3.h
) as detailed here. I resolved this by making the same change to the forward declaration inDatabase.h
. Unfortunately, I'm not sure how to fix it in a backwards-compatible fashion since having access toSQLITE_VERSION_NUMBER
inDatabase.h
would require including the header those declarations are there to avoid.The text was updated successfully, but these errors were encountered: