set(CMAKE_SYSTEM_NAME Linux CACHE INTERNAL "")

string(REPLACE "-" "_" triple_ ${triple})
string(TOUPPER ${triple_} triple_)
set(LLVM_PREFIX $ENV{SMAKE_LLVM_PREFIX})
set(SYSROOT $ENV{SMAKE_LLVM_SYSROOT_${triple_}})

set(APPLE 0)
set(MSVC 0)
set(WIN32 0)
set(UNIX 1)

set(CMAKE_C_COMPILER ${LLVM_PREFIX}clang CACHE INTERNAL "" FORCE)
set(CMAKE_C_COMPILER_TARGET ${triple} CACHE INTERNAL "" FORCE)
set(CMAKE_CXX_COMPILER ${LLVM_PREFIX}clang++ CACHE INTERNAL "" FORCE)
set(CMAKE_CXX_COMPILER_TARGET ${triple} CACHE INTERNAL "" FORCE)
set(CMAKE_ASM_COMPILER_TARGET ${triple} CACHE INTERNAL "" FORCE)

set(CMAKE_SYSROOT ${SYSROOT} CACHE INTERNAL "" FORCE)

set(CMAKE_EXE_LINKER_FLAGS "-fuse-ld=lld -Wl,--as-needed " CACHE INTERNAL "" FORCE)
set(CMAKE_SHARED_LINKER_FLAGS "-fuse-ld=lld -Wl,--no-undefined -Wl,--as-needed" CACHE INTERNAL "" FORCE)
set(CMAKE_STATIC_LINKER_FLAGS "" CACHE INTERNAL "" FORCE)
set(CMAKE_MODULE_LINKER_FLAGS "-fuse-ld=lld -Wl,--as-needed " CACHE INTERNAL "" FORCE)

set(CMAKE_AR      ${LLVM_PREFIX}llvm-ar  CACHE INTERNAL "" FORCE)
set(CMAKE_LINKER  ${LLVM_PREFIX}clang++  CACHE INTERNAL "" FORCE)
set(CMAKE_NM      ${LLVM_PREFIX}llvm-nm  CACHE INTERNAL "" FORCE)
set(CMAKE_OBJDUMP ${LLVM_PREFIX}llvm-objdump  CACHE INTERNAL "" FORCE)
set(CMAKE_RANLIB  ${LLVM_PREFIX}llvm-ranlib  CACHE INTERNAL "" FORCE)

