2018-05-23 00:08:13 +02:00
|
|
|
cmake_minimum_required(VERSION 3.2)
|
|
|
|
|
|
|
|
set(CMAKE_SYSTEM_NAME Generic)
|
|
|
|
set(CMAKE_SYSTEM_VERSION 1)
|
2018-06-04 19:09:49 +02:00
|
|
|
set(CMAKE_SYSTEM_PROCESSOR "ppc")
|
|
|
|
set(CMAKE_CROSSCOMPILING 1)
|
2018-05-23 00:08:13 +02:00
|
|
|
|
2018-06-14 12:44:23 +02:00
|
|
|
if(NOT DEFINED ENV{DEVKITPPC})
|
2018-05-23 00:08:13 +02:00
|
|
|
message(FATAL_ERROR "You must have defined DEVKITPPC before calling cmake.")
|
|
|
|
endif()
|
|
|
|
|
2018-06-14 12:44:23 +02:00
|
|
|
if(NOT DEFINED ENV{WUT_ROOT})
|
2018-06-15 14:59:55 +02:00
|
|
|
message(FATAL_ERROR "You must have defined WUT_ROOT before calling cmake.")
|
2018-05-23 00:08:13 +02:00
|
|
|
endif()
|
|
|
|
|
2018-06-14 12:44:23 +02:00
|
|
|
set(DEVKITPPC $ENV{DEVKITPPC})
|
|
|
|
set(WUT_ROOT $ENV{WUT_ROOT})
|
2018-05-25 13:22:39 +02:00
|
|
|
|
|
|
|
set(CMAKE_ASM_COMPILER "${DEVKITPPC}/bin/powerpc-eabi-gcc${CMAKE_EXECUTABLE_SUFFIX}" CACHE PATH "")
|
|
|
|
set(CMAKE_C_COMPILER "${DEVKITPPC}/bin/powerpc-eabi-gcc${CMAKE_EXECUTABLE_SUFFIX}" CACHE PATH "")
|
|
|
|
set(CMAKE_CXX_COMPILER "${DEVKITPPC}/bin/powerpc-eabi-g++${CMAKE_EXECUTABLE_SUFFIX}" CACHE PATH "")
|
|
|
|
set(CMAKE_LINKER "${DEVKITPPC}/bin/powerpc-eabi-ld${CMAKE_EXECUTABLE_SUFFIX}" CACHE PATH "")
|
|
|
|
set(CMAKE_AR "${DEVKITPPC}/bin/powerpc-eabi-ar${CMAKE_EXECUTABLE_SUFFIX}" CACHE PATH "")
|
2018-05-23 00:08:13 +02:00
|
|
|
|
2018-06-02 11:37:02 +02:00
|
|
|
set(WUT_C_FLAGS "-mcpu=750 -meabi -mhard-float -Wl,-q \"-I${WUT_ROOT}/include\" -D__WIIU__ -D__WUT__")
|
2018-05-23 00:08:13 +02:00
|
|
|
set(CMAKE_C_FLAGS "${WUT_C_FLAGS}" CACHE STRING "")
|
|
|
|
set(CMAKE_CXX_FLAGS "${WUT_C_FLAGS}" CACHE STRING "")
|
|
|
|
set(CMAKE_ASM_FLAGS "${WUT_C_FLAGS}" CACHE STRING "")
|
2018-05-28 12:39:54 +02:00
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "-Wl,-z,nocopyreloc -T \"${WUT_ROOT}/share/wut.ld\" \"-L${WUT_ROOT}/lib\"" CACHE STRING "")
|
2018-05-23 00:08:13 +02:00
|
|
|
|
|
|
|
# Setup root to exclude host system headers + libraries
|
|
|
|
set(CMAKE_FIND_ROOT_PATH "${DEVKITPPC}" "${WUT_ROOT}/bin" "${CMAKE_INSTALL_PREFIX}" "${CMAKE_INSTALL_PREFIX}/share")
|
|
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
|
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
|
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
|
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
|
|
|
|
|
|
|
# Tools
|
2018-05-23 13:35:24 +02:00
|
|
|
set(WUT_ELF2RPL "${WUT_ROOT}/bin/elf2rpl${CMAKE_EXECUTABLE_SUFFIX}" CACHE PATH "")
|
2018-05-30 19:54:41 +02:00
|
|
|
set(WUT_RPLEXPORTGEN "${WUT_ROOT}/bin/rplexportgen${CMAKE_EXECUTABLE_SUFFIX}" CACHE PATH "")
|
2018-05-23 00:08:13 +02:00
|
|
|
|
|
|
|
# Flags
|
|
|
|
set(WUT TRUE)
|
2018-06-04 19:09:10 +02:00
|
|
|
set(WIIU TRUE)
|
|
|
|
|
|
|
|
# There is no shared lib support in devkitPPC
|
|
|
|
set(BUILD_SHARED_LIBS OFF CACHE INTERNAL "Shared libs not available")
|