set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_SYSTEM_VERSION 1.0)

set(CLANG_TARGET_TRIPLE arm-none-eabi)

# set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) # Disabling the compiler check is not working for clang-8.0.0 
set(CMAKE_C_COMPILER_WORKS 1)
set(CMAKE_CXX_COMPILER_WORKS 1)
set(CMAKE_SYSROOT $ENV{CROSS_LLVM_SYSROOT_PATH})

set(CMAKE_C_COMPILER ${CROSS_COMPILER_PATH}/bin/clang)
set(CMAKE_C_COMPILER_TARGET ${CLANG_TARGET_TRIPLE})
set(CMAKE_CXX_COMPILER ${CROSS_COMPILER_PATH}/bin/clang++)
set(CMAKE_CXX_COMPILER_TARGET ${CLANG_TARGET_TRIPLE})
set(CMAKE_ASM_COMPILER {CROSS_COMPILER_PATH}/bin/clang)
set(CMAKE_ASM_COMPILER_TARGET ${CLANG_TARGET_TRIPLE})
set(CMAKE_AR                    ${CROSS_COMPILER_PATH}/bin/llvm-ar)
set(CMAKE_LINKER                ${CROSS_COMPILER_PATH}/bin/llvm-link)
set(CMAKE_OBJCOPY               ${CROSS_COMPILER_PATH}/bin/llvm-objcopy)
set(CMAKE_RANLIB                ${CROSS_COMPILER_PATH}/bin/llvm-ranlib)
set(CMAKE_SIZE                  ${CROSS_COMPILER_PATH}/bin/llvm-size)
set(CMAKE_STRIP                 ${CROSS_COMPILER_PATH}/bin/llvm-strip)

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)

