3DS, PSP2, Wii: Simplify CMake toolchains

This commit is contained in:
Jeffrey Pfau 2016-10-21 13:29:41 -07:00
parent 8aee104862
commit a86184df43
3 changed files with 24 additions and 24 deletions

View File

@ -22,7 +22,7 @@ if (CMAKE_HOST_WIN32)
endif()
set(CMAKE_PROGRAM_PATH ${DEVKITARM}/bin)
set(cross_prefix ${CMAKE_PROGRAM_PATH}/arm-none-eabi-)
set(cross_prefix arm-none-eabi-)
set(arch_flags "-march=armv6k -mtune=mpcore -mfpu=vfp -mfloat-abi=hard")
set(inc_flags "-I${CTRULIB}/include ${arch_flags} -mword-relocations")
set(link_flags "-L${CTRULIB}/lib -lctru -specs=3dsx.specs ${arch_flags}")
@ -31,15 +31,15 @@ set(CMAKE_SYSTEM_NAME Generic CACHE INTERNAL "system name")
set(CMAKE_SYSTEM_PROCESSOR arm CACHE INTERNAL "processor")
set(CMAKE_LIBRARY_ARCHITECTURE arm-none-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")
find_program(CMAKE_AR ${cross_prefix}gcc-ar${extension})
find_program(CMAKE_RANLIB ${cross_prefix}gcc-ranlib${extension})
find_program(CMAKE_C_COMPILER ${cross_prefix}gcc${extension})
find_program(CMAKE_CXX_COMPILER ${cross_prefix}g++${extension})
find_program(CMAKE_ASM_COMPILER ${cross_prefix}gcc${extension})
find_program(CMAKE_LINKER ${cross_prefix}ld${extension})
set(CMAKE_C_FLAGS ${inc_flags} CACHE INTERNAL "c compiler flags")
set(CMAKE_ASM_FLAGS ${inc_flags} CACHE INTERNAL "c compiler flags")
set(CMAKE_ASM_FLAGS ${inc_flags} CACHE INTERNAL "assembler flags")
set(CMAKE_CXX_FLAGS ${inc_flags} CACHE INTERNAL "cxx compiler flags")
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")

View File

@ -12,7 +12,7 @@ endif()
set(toolchain_dir ${VITASDK})
set(CMAKE_PROGRAM_PATH ${toolchain_dir}/bin)
set(cross_prefix ${CMAKE_PROGRAM_PATH}/arm-vita-eabi-)
set(cross_prefix arm-vita-eabi-)
set(inc_flags -I${toolchain_dir}/include)
set(link_flags "-L${toolchain_dir}/lib -Wl,-q")
@ -20,15 +20,15 @@ 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")
find_program(CMAKE_AR ${cross_prefix}gcc-ar${extension})
find_program(CMAKE_RANLIB ${cross_prefix}gcc-ranlib${extension})
find_program(CMAKE_C_COMPILER ${cross_prefix}gcc${extension})
find_program(CMAKE_CXX_COMPILER ${cross_prefix}g++${extension})
find_program(CMAKE_ASM_COMPILER ${cross_prefix}gcc${extension})
find_program(CMAKE_LINKER ${cross_prefix}ld${extension})
set(CMAKE_C_FLAGS ${inc_flags} CACHE INTERNAL "c compiler flags")
set(CMAKE_ASM_FLAGS ${inc_flags} CACHE INTERNAL "c compiler flags")
set(CMAKE_ASM_FLAGS ${inc_flags} CACHE INTERNAL "assembler flags")
set(CMAKE_CXX_FLAGS ${inc_flags} CACHE INTERNAL "cxx compiler flags")
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")

View File

@ -16,7 +16,7 @@ if (CMAKE_HOST_WIN32)
endif()
set(CMAKE_PROGRAM_PATH ${DEVKITPPC}/bin)
set(cross_prefix ${CMAKE_PROGRAM_PATH}/powerpc-eabi-)
set(cross_prefix powerpc-eabi-)
set(arch_flags "-mrvl -mcpu=750 -meabi -mhard-float -g")
set(inc_flags "-I${DEVKITPRO}/libogc/include ${arch_flags}")
set(link_flags "-L${DEVKITPRO}/libogc/lib/wii ${arch_flags}")
@ -25,15 +25,15 @@ set(CMAKE_SYSTEM_NAME Generic CACHE INTERNAL "system name")
set(CMAKE_SYSTEM_PROCESSOR powerpc CACHE INTERNAL "processor")
set(CMAKE_LIBRARY_ARCHITECTURE powerpc-none-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")
find_program(CMAKE_AR ${cross_prefix}gcc-ar${extension})
find_program(CMAKE_RANLIB ${cross_prefix}gcc-ranlib${extension})
find_program(CMAKE_C_COMPILER ${cross_prefix}gcc${extension})
find_program(CMAKE_CXX_COMPILER ${cross_prefix}g++${extension})
find_program(CMAKE_ASM_COMPILER ${cross_prefix}gcc${extension})
find_program(CMAKE_LINKER ${cross_prefix}ld${extension})
set(CMAKE_C_FLAGS ${inc_flags} CACHE INTERNAL "c compiler flags")
set(CMAKE_ASM_FLAGS ${inc_flags} CACHE INTERNAL "c compiler flags")
set(CMAKE_ASM_FLAGS ${inc_flags} CACHE INTERNAL "assembler flags")
set(CMAKE_CXX_FLAGS ${inc_flags} CACHE INTERNAL "cxx compiler flags")
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")