aarch64-semihosting.toolchain.cmake 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # This file is part of OpenCV project.
  2. # It is subject to the license terms in the LICENSE file found in the top-level directory
  3. # of this distribution and at http://opencv.org/license.html
  4. set(CMAKE_SYSTEM_NAME Generic)
  5. set(CMAKE_SYSTEM_PROCESSOR AArch64)
  6. set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
  7. set(PORT_FILE ${CMAKE_SOURCE_DIR}/platforms/semihosting/include/aarch64_semihosting_port.hpp)
  8. set(COMMON_FLAGS "--specs=rdimon.specs -DOPENCV_INCLUDE_PORT_FILE=\\\"${PORT_FILE}\\\"")
  9. set(CMAKE_AR ${SEMIHOSTING_TOOLCHAIN_PATH}aarch64-none-elf-ar${CMAKE_EXECUTABLE_SUFFIX})
  10. set(CMAKE_ASM_COMPILER ${SEMIHOSTING_TOOLCHAIN_PATH}aarch64-none-elf-gcc${CMAKE_EXECUTABLE_SUFFIX})
  11. set(CMAKE_C_COMPILER ${SEMIHOSTING_TOOLCHAIN_PATH}aarch64-none-elf-gcc${CMAKE_EXECUTABLE_SUFFIX})
  12. set(CMAKE_CXX_COMPILER ${SEMIHOSTING_TOOLCHAIN_PATH}aarch64-none-elf-g++${CMAKE_EXECUTABLE_SUFFIX})
  13. set(CMAKE_LINKER ${SEMIHOSTING_TOOLCHAIN_PATH}aarch64-none-elf-ld${CMAKE_EXECUTABLE_SUFFIX})
  14. set(CMAKE_OBJCOPY ${SEMIHOSTING_TOOLCHAIN_PATH}aarch64-none-elf-objcopy${CMAKE_EXECUTABLE_SUFFIX} CACHE INTERNAL "")
  15. set(CMAKE_RANLIB ${SEMIHOSTING_TOOLCHAIN_PATH}aarch64-none-elf-ranlib${CMAKE_EXECUTABLE_SUFFIX} CACHE INTERNAL "")
  16. set(CMAKE_SIZE ${SEMIHOSTING_TOOLCHAIN_PATH}aarch64-none-elf-size${CMAKE_EXECUTABLE_SUFFIX} CACHE INTERNAL "")
  17. set(CMAKE_STRIP ${SEMIHOSTING_TOOLCHAIN_PATH}aarch64-none-elf-strip${CMAKE_EXECUTABLE_SUFFIX} CACHE INTERNAL "")
  18. set(CMAKE_C_FLAGS ${COMMON_FLAGS} CACHE INTERNAL "")
  19. set(CMAKE_CXX_FLAGS ${COMMON_FLAGS} CACHE INTERNAL "")
  20. set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
  21. set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
  22. set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
  23. set(OPENCV_SEMIHOSTING ON)
  24. set(OPENCV_DISABLE_THREAD_SUPPORT ON)
  25. set(OPENCV_DISABLE_FILESYSTEM_SUPPORT ON)
  26. set(BUILD_SHARED_LIBS OFF)
  27. set(OPENCV_FORCE_3RDPARTY_BUILD OFF)
  28. # Enable newlib.
  29. add_definitions(-D_GNU_SOURCE)
  30. add_definitions(-D_POSIX_PATH_MAX=0)