set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)

set(BUILDROOT_VARIANT "buildroot")

set(CMAKE_SYSROOT $ENV{BUILDROOT_SDK_PATH}/aarch64-${BUILDROOT_VARIANT}-linux-gnu/sysroot)

set(CMAKE_C_COMPILER clang)
set(CMAKE_CXX_COMPILER clang++)

set(CMAKE_C_FLAGS "--target=aarch64-linux-gnueabihf -mcpu=cortex-a72")
set(CMAKE_CXX_FLAGS "--target=aarch64-linux-gnueabihf -mcpu=cortex-a72")
set(CMAKE_EXE_LINKER_FLAGS "-fuse-ld=lld")

set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")

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)