toolchain-sparc-elf.cmake 825 B

1234567891011121314151617181920212223242526272829
  1. include(CMakeForceCompiler)
  2. SET(CMAKE_SYSTEM_NAME SPARC-ELF)
  3. # The environment variables should be already set
  4. # in order to do proper cross compiling
  5. CMAKE_FORCE_C_COMPILER(sparc-elf-gcc GNU)
  6. CMAKE_FORCE_CXX_COMPILER(sparc-elf-g++ GNU)
  7. set (CMAKE_C_FLAGS $ENV{CFLAGS})
  8. set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS $ENV{LDFLAGS})
  9. add_definitions(-std=c99)
  10. set (CMAKE_AR sparc-elf-ar)
  11. set (CMAKE_RANLIB sparc-elf-ranlib)
  12. SET(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> <LINK_FLAGS> cr <TARGET> <OBJECTS>")
  13. SET(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
  14. # search for programs in the build host directories
  15. SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
  16. # for libraries and headers in the target directories
  17. SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER)
  18. SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER)
  19. set(CMAKE_BUILD_TYPE Release)