Update README.md

This commit is contained in:
James 2018-06-14 12:26:25 +01:00 committed by GitHub
parent 36e3995e5c
commit 3c119996bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,13 +5,37 @@ 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+).
## Requirements
## Usage
See [samples](samples) for examples of how to use wut.
The [share/wut.cmake](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_sd(target)` - This links in wutdevoptab_sd 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)
```
## Building
Requires:
- A modern compiler with C++14/17 support
- CMake
- zlib
- [devkitPPC r31+](https://devkitpro.org/wiki/Getting_Started)
## Windows
### Building on Windows
Use [WSL](https://docs.microsoft.com/en-us/windows/wsl/install-win10) and then follow the Linux instructions.
For example, if you installed Ubuntu then you might setup your environment like:
@ -23,7 +47,7 @@ sudo dpkg -i devkitpro-pacman.deb
sudo dkp-pacman -S devkitPPC wiiload
```
## Linux / MacOS
### Building on Linux / MacOS
```
export DEVKITPPC=/opt/devkitpro/devkitPPC
git clone --recursive https://github.com/decaf-emu/wut.git