set(BINUTILS_PATH "C:/MinGW")

#set(CMAKE_EXE_LINKER_FLAGS_INIT "--specs=nano.specs --specs=nosys.specs")

# Without that flag CMake is not able to pass test compilation check
#set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)

set(CMAKE_C_COMPILER "${BINUTILS_PATH}/bin/gcc.exe")
set(CMAKE_CXX_COMPILER "${BINUTILS_PATH}/bin/c++.exe")
set(CMAKE_ASM_COMPILER "${CMAKE_C_COMPILER}")

#set(CMAKE_OBJCOPY "${BINUTILS_PATH}/bin/${TOOLCHAIN_PREFIX}objcopy.exe" CACHE INTERNAL "objcopy tool")
#set(CMAKE_SIZE_UTIL "${BINUTILS_PATH}/bin/${TOOLCHAIN_PREFIX}size.exe" CACHE INTERNAL "size tool")

set(CMAKE_FIND_ROOT_PATH ${BINUTILS_PATH})
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
