From eb2315cdd8197009372e18170fb12afe2381db46 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Mon, 8 Dec 2014 16:02:11 -0800 Subject: [PATCH] 3DS: Add CMakeToolchain for 3DS --- src/platform/3ds/CMakeToolchain.txt | 35 +++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/platform/3ds/CMakeToolchain.txt diff --git a/src/platform/3ds/CMakeToolchain.txt b/src/platform/3ds/CMakeToolchain.txt new file mode 100644 index 000000000..b3bdc36ae --- /dev/null +++ b/src/platform/3ds/CMakeToolchain.txt @@ -0,0 +1,35 @@ +if(DEFINED ENV{DEVKITPRO}) + set(DEVKITPRO $ENV{DEVKITPRO}) +else() + message(FATAL_ERROR "Could not find DEVKITPRO in environment") +endif() + +if(ENV{DEVKITARM) + set(DEVKITARM $ENV{DEVKITARM}) +else() + set(DEVKITARM ${DEVKITPRO}/devkitARM) +endif() + +set(toolchain_bin_dir ${DEVKITARM}/bin) +set(cross_prefix ${toolchain_bin_dir}/arm-none-eabi-) +set(inc_flags -I${DEVKITPRO}/libcrtu/include) +set(link_flags -L${DEVKITPRO}/libcrtu/lib) + +set(CMAKE_SYSTEM_NAME Unknown 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}ar CACHE FILEPATH "archiver") +set(CMAKE_C_COMPILER ${cross_prefix}gcc) +set(CMAKE_CXX_COMPILER ${cross_prefix}g++) +set(CMAKE_ASM_COMPILER ${cross_prefix}gcc) +set(common_flags "-march=armv6k -mtune=mpcore -mfpu=vfp ${inc_flags}") +set(CMAKE_C_FLAGS ${common_flags} CACHE INTERNAL "c compiler flags") +set(CMAKE_ASM_FLAGS ${common_flags} CACHE INTERNAL "c compiler flags") +set(CMAKE_CXX_FLAGS ${common_flags} CACHE INTERNAL "cxx compiler flags") +set(CMAKE_LINKER ${cross_prefix}ld) + +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") + +set(3DS ON)