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.

mips-mti-linux-gnu.toolchain.cmake 789 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 mips )
  4. # make sure mips-mti-linux-gnu-gcc and mips-mti-linux-gnu-g++ can be found in $PATH:
  5. SET ( CMAKE_C_COMPILER "mips-mti-linux-gnu-gcc" )
  6. SET ( CMAKE_CXX_COMPILER "mips-mti-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=mips32r6 -mmsa -fopenmp ${CMAKE_CXX_FLAGS}" )
  13. # other settings
  14. add_definitions(-D__MIPS_MSA)
  15. add_definitions(-DLINUX)
  16. SET ( LINUX true)