Skip to content
ouncebrewPublic

About

Library for Switch 2 homebrew

Resources

Stars

2 stars

Watchers

1 watching

Forks

Latest commit

 

History

2,248 Commits

Folders and files

Repository files navigation

libounce

libounce is libnx with changes and additions made for Switch 2.

Build and install

With devkitPro's devkitA64 (switch-dev):

make
make install

make install installs libounce into $DEVKITPRO/libounce.

make switch1 and make install-switch1 build plain libnx and install it into $DEVKITPRO/libnx, as upstream does.

Packages

libounce is in the [ounce] repository for devkitPro's pacman, with OunceVK and libkaihen: see https://github.com/ouncebrew/pacman. Each release also has the package attached, for dkp-pacman -U. It installs the same files as make install and pulls in the devkitPro packages it builds on.

packaging/Dockerfile builds the package with dkp-makepkg in devkitPro's image. Pushing a version tag (the date, as 20261118) builds it on GitHub and publishes the release, with the annotated tag's message as its notes; packaging/release.sh does the same locally.

Use

In a Makefile where libnx is used, include libounce's rules in place of libnx's:

include $(DEVKITPRO)/libounce/switch2_rules

Then use -lnx to link libounce. If you want a small program that uses newlib's malloc, link -lounce_core instead. switch2_cpu.mk gives the CPU flags for Makefiles that do not use the rules.

For CMake, Meson or autotools, make install also installs $DEVKITPRO/switch2vars.sh, the CMake toolchain ($DEVKITPRO/libounce/cmake/Switch2.cmake) and aarch64-none-elf-cmake:

source $DEVKITPRO/switch2vars.sh
aarch64-none-elf-cmake -S . -B build && cmake --build build

License

libnx and libounce: ISC (LICENSE and LICENSES/). mimalloc (nx/external/mimalloc): MIT. The CMake toolchain and switch2vars.sh (toolchain/): MIT (LICENSES/toolchain-MIT.txt).

libnx is by switchbrew and its contributors: https://github.com/switchbrew/libnx.

About

Library for Switch 2 homebrew

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages