blob: 6a94d9f80591592314fcc50625af757a3f607435 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# PSn00bSDK example CMake script
# (C) 2021 spicyjpeg - MPL licensed
cmake_minimum_required(VERSION 3.21)
project(
cartrom
LANGUAGES C ASM
VERSION 1.0.0
DESCRIPTION "PSn00bSDK expansion port ROM example"
HOMEPAGE_URL "http://lameguy64.net/?page=psn00bsdk"
)
file(GLOB _sources *.c *.s)
# This example only uses the toolchain (without the rest of the SDK), so the
# executable has to be created manually and converted into raw binary format
# (for testing on emulators or flashing to a cheat cartridge).
add_executable (cartrom ${_sources})
target_link_options (cartrom PRIVATE -T${PROJECT_SOURCE_DIR}/rom.ld)
set_target_properties(
cartrom PROPERTIES
PREFIX ""
SUFFIX ".elf"
PSN00BSDK_TARGET_TYPE EXECUTABLE_NOGPREL
)
target_include_directories(cartrom PRIVATE ${PROJECT_SOURCE_DIR})
add_custom_command(
TARGET cartrom POST_BUILD
COMMAND ${CMAKE_OBJCOPY} -O binary cartrom.elf cartrom.bin
BYPRODUCTS cartrom.bin
)
install(FILES ${PROJECT_BINARY_DIR}/cartrom.bin TYPE BIN)
|