Support compilation against spdlog 1.14 with fmt 10 #1048
Merged
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.
I need to integrate depthai-core with a codebase that already uses a recent version of spdlog 1.14 with fmt 10, but trying to patch depthai-core to use an external spdlog 1.14 using fmt 10 (using the patch in #1021 (comment)), resulted in the following errors:
Click to see errors
and
I was able to get the project to compile (and run, tested on a OAD-D SR) with the modification proposed in this PR. The modifications proposed are backward compatible (thanks to the use of
#if FMT_VERSION >= 100000
blocks, that ensure that the additional code and include are only used if the fmt version is higher than 10.0.0 .While this modifications can only be tested with a patch like #1021 (comment) or disabling hunter, I still think it could be helpful to have the change integrated in the main branch, as not using hunter seems a recurring need in depthai-core users (see #1021, #411, #447, #468).