Add CMake options EMBED_RESOURCE_FILES and USE_ONLY_EMBEDDED_RESOURCE_FILES for proj.db and proj.ini embedding#4265
Merged
rouault merged 9 commits intoOSGeo:masterfrom Oct 28, 2024
Merged
Conversation
eschnett
reviewed
Oct 3, 2024
eschnett
reviewed
Oct 3, 2024
eschnett
reviewed
Oct 3, 2024
cmake/FileEmbed.cmake
Outdated
| const uint8_t ${c_name}_data[] = { | ||
| ${output_c} | ||
| }\; | ||
| unsigned ${c_name}_size = sizeof(${c_name}_data)\; |
Member
Author
There was a problem hiding this comment.
we are not going to embed more than 2 GB, so unsigned is fine
eschnett
reviewed
Oct 3, 2024
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.
In principle the ..._size constant isn't needed. It isn't generated by the #embed directive either.
Member
Author
There was a problem hiding this comment.
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
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #4274