-
Notifications
You must be signed in to change notification settings - Fork 788
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
Add CMake options EMBED_RESOURCE_FILES and USE_ONLY_EMBEDDED_RESOURCE_FILES for proj.db and proj.ini embedding #4265
Conversation
cmake/FileEmbed.cmake
Outdated
const uint8_t ${c_name}_data[] = { | ||
${output_c} | ||
}\; | ||
unsigned ${c_name}_size = sizeof(${c_name}_data)\; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use size_t
instead of unsigned
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are not going to embed more than 2 GB, so unsigned is fine
cmake/FileEmbed.cmake
Outdated
#define ${c_name}_H | ||
#include \"stdint.h\" | ||
extern const uint8_t ${c_name}_data[]\; | ||
extern unsigned ${c_name}_size\; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In principle the ..._size
constant isn't needed. It isn't generated by the #embed
directive either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we are accessing the resource through the .h file, we cannot do a sizeof(proj_db_data), so we need a variable giving the size. We do need the size to pass it to the SQLite3 memvfs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
D'oh.
af1e1df
to
f26ff65
Compare
…gus CRS meant to trigger a syntax error in proj_create"' Other changes in SQLiteHandle so that ATTACH DATABASE properly works
Implements #4274