all repos — mgba @ a86184df43bb8e0ab6ae3661d297cb12c5e91156

mGBA Game Boy Advance Emulator

3DS, PSP2, Wii: Simplify CMake toolchains
Jeffrey Pfau jeffrey@endrift.com
Fri, 21 Oct 2016 13:29:41 -0700
commit

a86184df43bb8e0ab6ae3661d297cb12c5e91156

parent

8aee10486211a8b549dcc2a9d42a4174b2ded1a0

M src/platform/3ds/CMakeToolchain.txtsrc/platform/3ds/CMakeToolchain.txt

@@ -22,7 +22,7 @@ set(extension .exe)

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")
M src/platform/psp2/CMakeToolchain.vitasdksrc/platform/psp2/CMakeToolchain.vitasdk

@@ -12,7 +12,7 @@

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")
M src/platform/wii/CMakeToolchain.txtsrc/platform/wii/CMakeToolchain.txt

@@ -16,7 +16,7 @@ set(extension .exe)

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")