set(CMAKE_SYSTEM_NAME      nx)
set(CMAKE_SYSTEM_PROCESSOR aarch64)

# Please update the following.
set(CMAKE_C_COMPILER       "clang")
set(CMAKE_AR               "llvm-ar")
set(CMAKE_C_FLAGS          "-target aarch64-none-elf -mcpu=cortex-a57 -ffreestanding -nostdinc -nostdlib -I${CMAKE_CURRENT_SOURCE_DIR}/resources/clang-include -O2 -g0")

# Magic
set(CMAKE_C_FLAGS_INIT "" CACHE STRING "" FORCE)
set(CMAKE_EXE_LINKER_FLAGS_INIT "" CACHE STRING "" FORCE)
set(CMAKE_SHARED_LINKER_FLAGS_INIT "" CACHE STRING "" FORCE)
unset(CMAKE_SYSROOT CACHE)
unset(CMAKE_SYSROOT_COMPILE CACHE)
unset(CMAKE_SYSROOT_LINK CACHE)
unset(CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN CACHE)
unset(CMAKE_C_COMPILER_TARGET CACHE)
unset(CMAKE_C_FLAGS CACHE)
unset(CMAKE_C_FLAGS_DEBUG CACHE)
unset(CMAKE_C_FLAGS_RELEASE CACHE)
set(CMAKE_POSITION_INDEPENDENT_CODE OFF)
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
