Basic sample project illustrating use of CMake with the XboxDev/nxdk.
The sample project uses https://pypi.org/project/nv2a-vsh to build a trivial passthrough vertex shader. It may be
installed by running pip install -r requirements.txt from this directory.
Under Settings > Build, Execution, Deployment > CMake
-
Provide the path to the nxdk toolchain file under CMake Options
-DCMAKE_TOOLCHAIN_FILE=$CMakeProjectDir$/third_party/nxdk/share/toolchain-nxdk.cmake -
Optionally modify the
PATHvariable to make sure the path to your chosen version of Clang comes first.
Using xemu
- Create a new
Embedded GDB Servertarget - Set the Target to the
<your project name>_xisotarget - Set the Executable to the
<your project name>binary (it should be the only thing in the dropdown) - Set
Upload executabletoNever - Set
'target remote' argsto127.0.0.1:1234 - Set
GDB Serverto the path to the xemu binary - Set
GDB Server argsto-s -S -dvd_path "$CMakeCurrentBuildDir$/xiso/<your_project_name>_xiso/<your_project_name>_xiso.iso"(the-Sis optional and will cause xemu to wait for the debugger to connnect) - Under
Advanced GDB Server Options - Set "Working directory" to
$ProjectFileDir$ - On macOS, set "Environment variables"
to
DYLD_FALLBACK_LIBRARY_PATH=/<the full path to your xemu.app bundle>/Contents/Libraries/<the architecture for your platform, e.g., arm64> - Set "Reset command" to
Never
Using xbdm_gdb_bridge and a devkit/XBDM-enabled Xbox
- Create a new
Embedded GDB Servertarget - Set the Target to the
<your project name>_xisotarget - Set the Executable to the
<your project name>binary (it should be the only thing in the dropdown) - Set
Upload executabletoNever - Set
'target remote' argsto127.0.0.1:1999 - Set
GDB Serverto the path to the xbdm_gdb_bridge binary (e.g.,<some_path>/xbdm_gdb_bridge) - Set
GDB Server argsto<your_xbox_ip> -v3 -s -- gdb :1999 e:\$CMakeCurrentTargetName$ - Under
Advanced GDB Server Options, setReset commandtoNever
To perform automatic deployment after builds:
- Under the
Before launchsection, click the+button and add a newRun external toolentry. - Set the
Descriptionfield to something likeSync program and resources to the XBOX - Set the
Programfield to the path to the xbdm_gdb_bridge binary (same as above) - Set
Argumentsto<your_xbox_ip> -- mkdir e:\$CMakeCurrentTargetName$ && %syncdir $CMakeCurrentBuildDir$/xbe/xbe_file e:\$CMakeCurrentTargetName$ -f - Set
Working directoryto$ProjectFileDir$