diff --git a/CMakeLists.txt b/CMakeLists.txt index beec9fbb427afadccef156139bd277d743e6999f..3a1dc22b43ce8326e295f2dce3db52c98c07d2d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -115,9 +115,12 @@ if (PYBIND) include(PybindDependency) add_pybind_dependency(${module_name}) ## + + target_link_libraries(${pybind_module_name} PRIVATE fmt::fmt) endif() -target_link_libraries(${module_name} PUBLIC Threads::Threads fmt::fmt) +target_link_libraries(${module_name} PRIVATE fmt::fmt) +target_link_libraries(${module_name} PUBLIC Threads::Threads) target_compile_features(${module_name} PRIVATE cxx_std_14) if (DOSANITIZE STREQUAL "ON") diff --git a/include/aidge/data/Elts.hpp b/include/aidge/data/Elts.hpp index 1a5a9e10ea131751ff5616eb2c310068d42ce991..bc4a225fc87a44e10a96da85f5b26048fbfad98c 100644 --- a/include/aidge/data/Elts.hpp +++ b/include/aidge/data/Elts.hpp @@ -101,12 +101,12 @@ private: template<> struct fmt::formatter<Aidge::Elts_t> { template<typename ParseContext> - inline constexpr auto parse(ParseContext& ctx) { + inline constexpr auto parse(ParseContext& ctx) -> decltype(ctx.begin()) { return ctx.begin(); } template<typename FormatContext> - inline auto format(Aidge::Elts_t const& elt, FormatContext& ctx) { + inline auto format(const Aidge::Elts_t& elt, FormatContext& ctx) const { return fmt::format_to(ctx.out(), "{}:{}", elt.data, elt.token); } }; diff --git a/unit_tests/CMakeLists.txt b/unit_tests/CMakeLists.txt index 2c0c746a412643c568ff07d8c50b5f5d8cbf72d5..8257a60633b5a4aef2c565a22a3606acab2803d8 100644 --- a/unit_tests/CMakeLists.txt +++ b/unit_tests/CMakeLists.txt @@ -63,6 +63,7 @@ endif() target_link_libraries(tests${module_name} PRIVATE ${module_name}) target_link_libraries(tests${module_name} PRIVATE Catch2::Catch2WithMain) +target_link_libraries(tests${module_name} PRIVATE fmt::fmt) list(APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR}/extras) include(CTest)