Let's try make a Wii U Toolchain / SDK for creating rpx/rpl.
Go to file
James Benton 9f0ff0f624 cmake: Set find path before using find_program.
Also use find_program for compilers.
2019-11-18 16:20:49 +00:00
cafe cafe: remove snd_core and snd_user 2019-05-04 20:56:31 +10:00
docs Fix URL and status (#107) 2019-06-20 14:37:26 +01:00
include Add missing function declarations 2019-07-02 01:04:27 -04:00
libraries Merge 'build-refactor' attempt #1; get upstream changes 2019-04-23 18:37:05 +10:00
samples samples: Remove deprecated cmake macros 2019-05-22 11:56:28 +10:00
share cmake: Set find path before using find_program. 2019-11-18 16:20:49 +00:00
tests include/coreinit: First pass at coreinit/codegen.h 2019-04-22 10:12:28 +10:00
.gitignore samples: port helloworld to make 2019-04-09 19:15:24 +10:00
.travis.yml Merge 'build-refactor' attempt #1; get upstream changes 2019-04-23 18:37:05 +10:00
CHANGELOG.md cafe: remove snd_core and snd_user 2019-05-04 20:56:31 +10:00
LICENSE.md Create LICENSE.md 2015-12-27 02:16:34 +00:00
Makefile cafe: remove snd_core and snd_user 2019-05-04 20:56:31 +10:00
README.md devkitPro is an organisation, not software 2019-03-20 10:24:01 +00:00

Build Status

wut

Let's try make a Wii U Toolchain / SDK for creating rpx/rpl.

Licensed under the terms of the GNU General Public License, version 2 or later (GPLv2+).

Install

It is recommended to install wut by using the devkitPro package manager

For example you might do:

sudo dkp-pacman -Syu devkitPPC wut-tools wut

Usage

See samples for examples of how to use wut.

The share/wut.cmake file provides several helpers for your build:

  • wut_create_rpx(target.rpx executable) - Will create an .rpx file from your CMake target generated by add_executable
  • wut_enable_newlib(target) - Links against the wut implementation of newlib, this is useful for using any function from the C standard library
  • wut_enable_stdcpp(target) - Links against the wut implementation of stdcpp, this is useful for using any function from the C++ standard library. This will call wut_enable_newlib if you have not already done so.
  • wut_default_malloc(target) - By default newlib will allocate 90% of the default heap for use with sbrk & malloc, if this is unacceptable to you then you should use this as it replaces the newlib malloc functions which ones which redirect to the CafeOS default heap functions such as MEMAllocFromDefaultHeap.
  • wut_enable_devoptab(target) - This links in wutdevoptab which is useful for using the libc file functions with paths such as fopen("sd:/file.txt", "r") to read files from the sd card

A minimal CMakeLists.txt file for a C++ project might look like:

cmake_minimum_required(VERSION 3.2)
project(helloworld_cpp CXX)
include("${WUT_ROOT}/share/wut.cmake" REQUIRED)

add_executable(helloworld_cpp
   main.cpp)

wut_enable_stdcpp(helloworld_cpp)
wut_create_rpx(helloworld_cpp.rpx helloworld_cpp)

Which you would compile with

export DEVKITPPC=/opt/devkitpro/devkitPPC
export WUT_ROOT=<path/to/install>
mkdir build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE=$WUT_ROOT/share/wut.toolchain.cmake ../
make

Building

Requires:

Building with devkitPPC

Ensure you have the devkitPPC and wut-tools packages provided by devkitPro:

sudo dkp-pacman -Syu devkitPPC wut-tools
export DEVKITPRO=/opt/devkitpro
export DEVKITPPC=/opt/devkitpro/devkitPPC

Then you can build wut like any other CMake project:

git clone --recursive https://github.com/devkitPro/wut.git
cd wut
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=<path/to/install> ../
make install
export WUT_ROOT=<path/to/install>

Then for any wut project you want to build you must use the wut.toolchain.cmake script:

cd ../samples/helloworld
mkdir build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE=$WUT_ROOT/share/wut.toolchain.cmake ../
make

Building with a locally built wut-tools

If you have locally built wut-tools then just add the directory containing the built binaries to PATH and they should be used instead:

export PATH=/path/to/wut-tools/bin:$PATH
cd wut
mkdir build && cd build
cmake ../
make