aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: daa914116c03d2ba55662b3768df350f078366be (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#
# Copyright © 2020 浅倉麗子
#
# This file is part of LCD Colour Crunch
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <https://www.gnu.org/licenses/>.
#

cmake_minimum_required(VERSION 3.13)

set(CMAKE_TOOLCHAIN_FILE "$ENV{DOLCESDK}/share/dolce.toolchain.cmake" CACHE PATH "DolceSDK toolchain file")
set(DOLCESDK_CMAKE_FILE "$ENV{DOLCESDK}/share/dolce.cmake" CACHE PATH "DolceSDK CMake functions file")
include("${DOLCESDK_CMAKE_FILE}" REQUIRED)

option(CMAKE_TLS_VERIFY "Verify TLS" ON)
include(ExternalProject REQUIRED)

project(lcd-colour-crunch LANGUAGES C)

add_compile_options(
  -Os -std=c11
  -Wall -Wextra -Wdouble-promotion -Wshadow -Wundef
  -fsingle-precision-constant -fno-common -flto
  -ftree-vectorize -funsafe-math-optimizations
)

add_link_options(
  -nostdlib
)

# Build self

set(ELF "lcd-colour-crunch.elf")
set(SELF "eboot.bin")
set(BOOTPARAM "${CMAKE_CURRENT_BINARY_DIR}/boot_param.bin")

add_executable("${ELF}"
  main.c
  "${SFN_OBJ}"
)

target_link_libraries("${ELF}"
  SceAVConfig_stub
  SceLibc_stub
  SceLibKernel_stub
  SceNotificationUtil_stub
  SceRegMgr_stub
  SceSysmodule_stub
)

add_custom_command(OUTPUT "${BOOTPARAM}"
  COMMAND dolce-make-bootparam app_memsize 0x1000 "${BOOTPARAM}"
)

dolce_create_self("${SELF}"
  "${ELF}"
  UNSAFE
  BOOT_PARAM "${BOOTPARAM}"
)

# Build VPK

set(VPK "lcd-colour-crunch.vpk")
set(TITLE_NAME "LCD Colour Crunch")
set(TITLE_ID "AKRK00006")
set(TITLE_VER "01.03")

dolce_create_vpk("${VPK}" "${TITLE_ID}" "${SELF}"
  NAME "${TITLE_NAME}"
  VERSION "${TITLE_VER}"
  FILE
    right.txt sce_sys/about/right.txt
    right.gim sce_sys/about/right.gim
)

# Build kernel module for PSPEmu

add_subdirectory(pspemu-colour-crunch)