src/platform/switch/CMakeToolchain.txt (view raw)
1include(${CMAKE_CURRENT_LIST_DIR}/../cmake/devkitPro.cmake)
2
3if(DEFINED ENV{LIBNX})
4 set(LIBNX $ENV{LIBNX})
5else()
6 set(LIBNX ${DEVKITPRO}/libnx)
7endif()
8
9set(cross_prefix aarch64-none-elf-)
10set(arch_flags "-mtune=cortex-a57 -ffunction-sections -march=armv8-a+crc+crypto -mtp=soft -fPIE")
11set(inc_flags "-I${LIBNX}/include ${arch_flags}")
12set(link_flags "-L${LIBNX}/lib -lnx -specs=${LIBNX}/switch.specs ${arch_flags}")
13
14set(CMAKE_SYSTEM_PROCESSOR aarch64 CACHE INTERNAL "processor")
15set(CMAKE_LIBRARY_ARCHITECTURE aarch64-none-elf CACHE INTERNAL "abi")
16
17set(SWITCH ON)
18add_definitions(-D__SWITCH__)
19
20create_devkit(A64)
21
22set(CMAKE_FIND_ROOT_PATH ${DEVKITA64}/${CMAKE_LIBRARY_ARCHITECTURE} ${DEVKITPRO}/portlibs/switch)