Closed robert-harrison-klein closed 7 months ago
Hi Rob,
This is intentional. LIBASSERT_USE_FMT
just turns on the relevant code in the assert.hpp header and it's relying on the user having already appropriately installed fmt or linked against fmt::fmt. The thought was if a user is using this flag they should already be using fmt in their codebase. I'm happy to revisit this however presently I figured it was best to not try to have libassert manage this dependency.
I'll close for now, please let me know if there's anything else I can help with or if you have ideas for improving the current state of affairs!
Thanks for the help with this Jeremy. I finally figured out what I was doing wrong. I was including both fmt and libassert as subdirectories of my own project. Now that I am properly building and installing them as dependencies and using find_package in my CMakeLists.txt, fmt integration appears to work as intended.
Excellent! I’m glad you got it working!
Hello!
I don't think
fmt
integration currently works. You define a target,libassert::assert
, and specify that users can add a compile definitionLIBASSERT_USE_FMT
to enablefmt
integration on the target. However, you never link thefmt::fmt
library tolibassert::assert
, so enablingLIBASSERT_USE_FMT
results in a failure to compile. Specifically:I think the fix is pretty straightforward. I think you just need to add a
CMake
option forfmt
integration that will conditionally linklibassert::assert
tofmt::fmt
.Best, Rob