You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

aarch64-linux-gnu.toolchain.cmake 858 B

12345678910111213141516171819
  1. # set cross-compiled system type, it's better not use the type which cmake cannot recognized.
  2. SET ( CMAKE_SYSTEM_NAME Linux )
  3. SET ( CMAKE_SYSTEM_PROCESSOR aarch64 )
  4. # for the reason of aarch64-linux-gnu-gcc DONOT need to be installed, make sure aarch64-linux-gnu-gcc and aarch64-linux-gnu-g++ can be found in $PATH:
  5. SET ( CMAKE_C_COMPILER "aarch64-linux-gnu-gcc" )
  6. SET ( CMAKE_CXX_COMPILER "aarch64-linux-gnu-g++" )
  7. # set searching rules for cross-compiler
  8. SET ( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER )
  9. SET ( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
  10. SET ( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
  11. # set ${CMAKE_C_FLAGS} and ${CMAKE_CXX_FLAGS}flag for cross-compiled process
  12. SET ( CMAKE_CXX_FLAGS "-std=c++11 -march=armv8-a -fopenmp ${CMAKE_CXX_FLAGS}" )
  13. # other settings
  14. add_definitions(-D__ARM_NEON)
  15. add_definitions(-D__ANDROID__)
  16. SET ( ANDROID true)