mgba/src/platform/psp2/CMakeToolchain.vitasdk

47 lines
1.9 KiB
Plaintext
Raw Normal View History

2015-08-29 02:44:12 +00:00
if(DEFINED ENV{VITASDK})
set(VITASDK $ENV{VITASDK})
2015-07-04 21:42:09 +00:00
else()
2015-08-29 02:44:12 +00:00
message(FATAL_ERROR "Could not find VITASDK in environment")
2015-07-04 21:42:09 +00:00
endif()
set(extension)
if (CMAKE_HOST_WIN32)
set(extension .exe)
endif()
2015-08-29 02:44:12 +00:00
set(toolchain_dir ${VITASDK})
set(CMAKE_PROGRAM_PATH ${toolchain_dir}/bin)
set(cross_prefix ${CMAKE_PROGRAM_PATH}/arm-vita-eabi-)
2015-07-04 21:42:09 +00:00
set(inc_flags -I${toolchain_dir}/include)
2015-08-29 02:44:12 +00:00
set(link_flags "-L${toolchain_dir}/lib -Wl,-q")
2015-07-04 21:42:09 +00:00
set(CMAKE_SYSTEM_NAME Generic CACHE INTERNAL "system name")
set(CMAKE_SYSTEM_PROCESSOR armv7-a CACHE INTERNAL "processor")
set(CMAKE_LIBRARY_ARCHITECTURE arm-vita-eabi CACHE INTERNAL "abi")
set(CMAKE_AR ${cross_prefix}gcc-ar${extension} CACHE INTERNAL "archiver")
set(CMAKE_RANLIB ${cross_prefix}gcc-ranlib${extension} CACHE INTERNAL "archiver")
set(CMAKE_C_COMPILER ${cross_prefix}gcc${extension} CACHE INTERNAL "c compiler")
set(CMAKE_CXX_COMPILER ${cross_prefix}g++${extension} CACHE INTERNAL "cxx compiler")
set(CMAKE_ASM_COMPILER ${cross_prefix}gcc${extension} CACHE INTERNAL "assembler")
set(CMAKE_C_FLAGS ${inc_flags} CACHE INTERNAL "c compiler flags")
set(CMAKE_ASM_FLAGS ${inc_flags} CACHE INTERNAL "c compiler flags")
set(CMAKE_CXX_FLAGS ${inc_flags} CACHE INTERNAL "cxx compiler flags")
2015-07-04 21:42:09 +00:00
set(CMAKE_LINKER ${cross_prefix}ld CACHE INTERNAL "linker")
set(CMAKE_EXE_LINKER_FLAGS ${link_flags} CACHE INTERNAL "exe link flags")
set(CMAKE_MODULE_LINKER_FLAGS ${link_flags} CACHE INTERNAL "module link flags")
set(CMAKE_SHARED_LINKER_FLAGS ${link_flags} CACHE INTERNAL "shared link flags")
2015-12-29 22:18:23 +00:00
set(CMAKE_FIND_ROOT_PATH ${VITASDK}/arm-vita-eabi;${VITASDK})
2015-12-29 21:21:55 +00:00
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER CACHE INTERNAL "")
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY CACHE INTERNAL "")
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY CACHE INTERNAL "")
2016-01-06 05:12:00 +00:00
set(ENV{PKG_CONFIG_PATH} ${VITASDK}/arm-vita-eabi/lib/pkgconfig)
set(ENV{PKG_CONFIG_LIBDIR} ${VITASDK}/arm-vita-eabi/lib/pkgconfig)
2015-07-04 21:42:09 +00:00
set(PSP2 ON)
add_definitions(-DPSP2)
2015-08-29 22:32:44 +00:00
set(M_LIBRARY m)