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
Support dynamically linking against system double-conversion library #508
Support dynamically linking against system double-conversion library #508
Conversation
This fixes ultrajson#376 and is useful to Linux distribution packagers. New environment variables UJSON_BUILD_DC_INCLUDES and UJSON_BUILD_DC_LIBS allow overriding the include path for double-conversion and adding linker flags for an external double-conversion library. They should generally be used together.
Could you add a little Build Options section to the end of the readme to illustrate to others how to link against a system |
Yes. I can add that to this PR. |
Automatically disable building ./deps/double-conversion when UJSON_BUILD_DC_LIBS is set to a non-empty value.
for more information, see https://pre-commit.ci
Made some changes based on feedback. Ensured the bundled |
Codecov Report
@@ Coverage Diff @@
## main #508 +/- ##
=======================================
Coverage 88.88% 88.88%
=======================================
Files 6 6
Lines 1709 1709
=======================================
Hits 1519 1519
Misses 190 190 Continue to review full report at Codecov.
|
Do you need ujson to release this before you can go back to your work on the Fedora RPM? |
Not really—we can easily carry it as a downstream patch for now. |
New environment variables
UJSON_BUILD_DC_INCLUDES
andUJSON_BUILD_DC_LIBS
allow overriding the include path for double-conversion and adding linker flags for an external double-conversion library. They should generally be used together.This is particularly useful to Linux distribution packagers who would otherwise need a patch to unbundle
double-conversion
. (It may still be necessary torm -rf deps/double-conversion
; I have not checked, as Fedora Linux would require this anyway.)Fixes #375
Changes proposed in this pull request:
double-conversion
with environment variableUJSON_BUILD_DC_INCLUDES
. This allows multiple whitespace-delimited paths but as a consequence doesn’t support paths containing whitespace, which is probably acceptable for the intended uses. For example, Linux distributions building against a system copy ofdouble-conversion
will want something likeUJSON_BUILD_DC_INCLUDES=/usr/include/double-conversion
.double-conversion
with environment variableUJSON_BUILD_DC_LIBS
; by default there are still none. For example, Linux distributions building against a system copy ofdouble-conversion
will want something likeUJSON_BUILD_DC_LIBS=-ldouble-conversion
.