Errors when cross compiling hailort

I run the following commands to cross compile the hailort library:

cmake -DCMAKE_TOOLCHAIN_FILE=./toolchain.cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release
cmake --build build --config release --target libhailort

toolchain.cmake:

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_C_COMPILER <path_to_crosscompiler>/arm-poky-linux-gnueabi-gcc)
set(CMAKE_CXX_COMPILER <path_to_crosscompiler>/arm-poky-linux-gnueabi-g++)
set(CMAKE_SYSROOT <path_to_sysroot>/4.1.15-2.0.1/sysroots/cortexa9hf-neon-poky-linux-gnueabi)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

SET(GCC_COVERAGE_COMPILE_FLAGS "-march=armv7-a -mfpu=neon  -mfloat-abi=hard -mcpu=cortex-a9")
add_definitions(${GCC_COVERAGE_COMPILE_FLAGS})

I get the following error:

In file included from hailort/hailort/common/utils.hpp:20:0,
                 from hailort/hailort/common/utils.cpp:10:
hailort/hailort/common/logger_macros.hpp:46:25: error: specialization of 'template<class T, class Char, class Enable> struct fmt::v10::format ter' in different namespace [-fpermissive]
 template <> struct fmt::formatter<hailo_status> : fmt::ostream_formatter {};
                         ^
In file included from hailort/hailort/external/spdlog-src/include/spdlog/fmt/fmt.h:24:0,
                 from hailort/hailort/external/spdlog-src/include/spdlog/common.h:50,
                 from hailort/hailort/external/spdlog-src/include/spdlog/spdlog.h:12,
                 from hailort/hailort/common/logger_macros.hpp:31,
                 from hailort/hailort/common/utils.hpp:20,
                 from hailort/hailort/common/utils.cpp:10:
hailort/hailort/external/spdlog-src/include/spdlog/fmt/bundled/core.h:1087:8: error:   from definition of 'template<class T, class Char, clas s Enable> struct fmt::v10::formatter' [-fpermissive]
 struct formatter {
        ^

What could cause the error?

Hi @user01,
Our strong advice for YOCTO projects, is to build the hailort as part of the full image build wtih bitbake. Is that possible your end?

Not at this point.
Any way to disable the spdlog? The error seems to come from some kind of discrepancy between spdlog and the hailort library. Looks like it is pulled from github. Could it be a some kind of compatibility issue between different versions?

I ended up creating Yocto environment by following instructions on “Embedded Linux for i.MX” page on NXP website. Used Mickledore 4.2 (kernel 6.1) to be compatible with HailoRT Release 4.20.0. Then followed the instructions from HailoRT User Guide to integrate into Yocto.
The build was successful.