aboutsummaryrefslogtreecommitdiff
path: root/template
diff options
context:
space:
mode:
authorspicyjpeg <88942473+spicyjpeg@users.noreply.github.com>2021-11-28 18:15:14 +0100
committerspicyjpeg <88942473+spicyjpeg@users.noreply.github.com>2021-11-28 18:15:14 +0100
commita75b3fa4b1a1b882c33f533645ddae75c09dd697 (patch)
tree2b9bd90c0564b983a35971207116976425288da4 /template
parent6d9ceda63aefe8910e798b6b38a7783d00b855f1 (diff)
downloadpsn00bsdk-a75b3fa4b1a1b882c33f533645ddae75c09dd697.tar.gz
Switch to mipsel-none-elf, move docs, add template presets
Diffstat (limited to 'template')
-rw-r--r--template/CMakeLists.txt9
-rw-r--r--template/CMakePresets.json23
2 files changed, 24 insertions, 8 deletions
diff --git a/template/CMakeLists.txt b/template/CMakeLists.txt
index c0c05d0..4aa648f 100644
--- a/template/CMakeLists.txt
+++ b/template/CMakeLists.txt
@@ -3,14 +3,6 @@
cmake_minimum_required(VERSION 3.20)
-# CMAKE_TOOLCHAIN_FILE must be set to point to cmake/sdk.cmake in the PSn00bSDK
-# installation directory *before* calling project(). You don't have to hardcode
-# the path in your CMakeLists.txt as you can set it from the command line when
-# configuring (-DCMAKE_TOOLCHAIN_FILE=...) or using CMake presets.
-if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND DEFINED ENV{PSN00BSDK_LIBS})
- set(CMAKE_TOOLCHAIN_FILE $ENV{PSN00BSDK_LIBS}/cmake/sdk.cmake)
-endif()
-
project(
PSn00bSDK-template
LANGUAGES C CXX ASM
@@ -20,6 +12,7 @@ project(
)
psn00bsdk_add_executable(template STATIC main.c)
+
psn00bsdk_add_cd_image(
iso # Target name
template # Output file name (= template.bin + template.cue)
diff --git a/template/CMakePresets.json b/template/CMakePresets.json
new file mode 100644
index 0000000..d08b334
--- /dev/null
+++ b/template/CMakePresets.json
@@ -0,0 +1,23 @@
+{
+ "version": 2,
+ "cmakeMinimumRequired": {
+ "major": 3,
+ "minor": 20,
+ "patch": 0
+ },
+ "configurePresets": [
+ {
+ "name": "default",
+ "displayName": "Default configuration",
+ "description": "Use this preset to build the project using PSn00bSDK.",
+ "generator": "Ninja",
+ "binaryDir": "${sourceDir}/build",
+ "cacheVariables": {
+ "CMAKE_BUILD_TYPE": "Debug",
+ "CMAKE_TOOLCHAIN_FILE": "$env{PSN00BSDK_LIBS}/cmake/sdk.cmake",
+ "PSN00BSDK_TC": "",
+ "PSN00BSDK_TARGET": "mipsel-none-elf"
+ }
+ }
+ ]
+}