Skip to content

Add CMake toolchain files - #29

Open
capitalistspz wants to merge 1 commit into
wiiu-env:mainfrom
capitalistspz:main
Open

capitalistspz wants to merge 1 commit into
wiiu-env:mainfrom
capitalistspz:main

Conversation

@capitalistspz

@capitalistspz capitalistspz commented Sep 14, 2026 •

Copy link
Copy Markdown

Some convenient files for writing modules with CMake.

Usage as so:

CMakeLists.txt

cmake_minum_required(VERSION 4.0.2)
project(my_module)

if (NOT WUMS)
    message(FATAL_ERROR "This project requires the WUMS toolchain")
endif ()

add_executable(my_module main.cpp)
wums_create_module(my_module)

Configure and build

cmake -B build-dir -DCMAKE_TOOLCHAIN_FILE=$DEVKITPRO/wums/share/cmake/wums-toolchain.cmake
cmake --build build-dir

Or for presets users:

CMakePresets.json

{
  "version": 10,
  "cmakeMinimumRequired": {
    "major": 4,
    "minor": 0,
    "patch": 2
  },
  "configurePresets": [
    {
      "name": "wums",
      "displayName": "WUMS",
      "generator": "Ninja",
      "binaryDir": "${sourceDir}/build-dir",
      "toolchainFile": "$env{DEVKITPRO}/wums/share/cmake/wums-toolchain.cmake"
    }
  ]
}
cmake --preset build-wums
cmake --build build-dir

@capitalistspz

capitalistspz commented Sep 14, 2026 •

Copy link
Copy Markdown
Author

Also should the __WUM__ macro be defined? It's defined in this repo's Makefile, but not for any of the existing modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant