Skip to content

Instantly share code, notes, and snippets.

@nn9dev
Created January 27, 2024 01:32
Show Gist options
  • Save nn9dev/7f9df1e862cef39ad1cc85416c1c9a42 to your computer and use it in GitHub Desktop.
Save nn9dev/7f9df1e862cef39ad1cc85416c1c9a42 to your computer and use it in GitHub Desktop.
Setting up CLion with VitaSDK, a rough guide.

This guide assumes Linux, and it's also so i don't forget how in the future

Installing VitaSDK

But in case you don't want to...

  1. apt-get install make git cmake python3 python-is-python3
  2. in .bashrc, .profile, or both, add these lines:
export VITASDK=/usr/local/vitasdk
export PATH=$VITASDK/bin:$PATH # add vitasdk tool to $PATH
  1. Run in terminal
git clone https://github.com/vitasdk/vdpm ; cd vdpm ; ./bootstrap-vitasdk.sh ; ./install-all.sh
  1. Restart your terminal session

CLion setup (headache time)

This is the part where you open CLion. If you had it open before setting up VitaSDK, re-launch it.

The Toolchain

  1. File -> Settings -> Build, Execution, Deployment -> Toolchains -> Plus Button (+) -> 'System'
  2. Name it!
    • I just named mine plain ol' vitasdk.
  3. Settings:
  • CMake: Bundled
  • Build Tool: Detected: Ninja
  • C Compiler: /usr/local/vitasdk/bin/arm-vita-eabi-gcc
  • C++ Compiler: /usr/local/vitasdk/bin/arm-vita-eabi-g++
  • Debugger: /usr/local/vitasdk/bin/arm-vita-eabi-gdb

It should go without saying, but if you put your vitasdk in a different path, point these paths to wherever you put it.

The CMake configs

I opened a project for this part, specifically the hello_cpp_world sample from the vitasdk samples repo.

  1. File -> Settings -> Build, Execution, Deployment -> CMake
  2. By default, you may only have a Debug configuration. You can choose if you want to add a Release configuration.
    • I added a Release configuration just by pressing '+'
  3. For each configuration you plan to use with VitaSDK, change the Toolchain drop-down to your vitasdk toolchain.
    • This should automatically alter the name of the configuration.
  4. Reload your CMake configuration
  5. ???
  6. Profit!

Help!! I get an error that says "Please define VITASDK to point to your SDK path!"

This is some odd behavior on CLion's part. It doesn't respect .bashrc, so you should try adding the exports from before to your .profile.

Don't feel like adding something to your .profile?

  1. File -> Settings -> Build, Execution, Deployment -> CMake
  2. For each config you intend to use...
  3. Scroll down to "Environment"
  4. Add VITASDK=/usr/local/vitasdk or whereever else you put your VitaSDK

That's all! (I think)

@DionKill
Copy link

DionKill commented Mar 3, 2025

Yo, I tried to follow this tutorial using the flatpak version (cuz I have fedora and couldn't be bothered to install it manually) and I had to do a couple of additional things (in case someone else out there just ends up having the same problem :D)

On flatseal:

  • i've added a folder that clion can access, specifically /usr/local
  • and i've added the environment variable: VITASDK=/run/host/usr/local/vitasdk
    Then, in CLion, I've added this in CMake Options: -DCMAKE_TOOLCHAIN_FILE=/run/host/usr/local/vitasdk/share/vita.toolchain.cmake

And now it works! At least in theory, because in practice it builds an executable (?) but it isn't a vpk so i can't install it...

INSTANT EDIT: there's a dropdown menu next to the build button to choose the vpk... fixed!

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