Skip to content
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

Use system rapidjson, fall back to bundled. #119

Merged
merged 1 commit into from
Jun 21, 2024

Conversation

badshah400
Copy link
Contributor

Currently the rapidjson headers are hard-coded into davix_gcloud_utils.cpp in a way that makes it difficult to use external/system provided rapidjson headers rather than the bundled ones.

This commit uses find_package to look for an external instance of rapidjson, falling back to the bundled version in src/libs/rapidjson if that search fails. In either case, it sets up the variable RAPIDJSON_INCLUDE_DIRS pointing to the location of the headers and adds this to the list of DAVIX_INTERNAL_INCLUDES to allow the location to be included during compilation (via -I${RAPIDJSON_INCLUDE_DIRS}). Finally, it modifies the #include in davix_gcloud_utils.cpp to support a generic location.

Currently the `rapidjson` headers are hard-coded into
`davix_gcloud_utils.cpp` in a way that makes it difficult to use
external/system provided rapidjson headers rather than the bundled ones.

This commit uses `find_package` to look for an external instance of
rapidjson, falling back to the bundled version in `src/libs/rapidjson`
if that search fails. In either case, it sets up the variable
`RAPIDJSON_INCLUDE_DIRS` pointing to the location of the headers and
adds this to the list of `DAVIX_INTERNAL_INCLUDES` to allow the location
to be included during compilation (via `-I${RAPIDJSON_INCLUDE_DIRS}`).
Finally, it modifies the `#include` in `davix_gcloud_utils.cpp` to
support a generic location.
@badshah400
Copy link
Contributor Author

I have tested this both with and without system installed rapidjson.

@mpatrascoiu
Copy link
Contributor

Thanks! Added to devel branch.

Cheers,
Mihai

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants