summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: c1159245ae2f214eeeaa22d3429e928e34b4d65a (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
#
#   Copyright (C) 2020-2021 Reiko Asakura. All Rights Reserved.
#
#   Moonshine
#

cmake_minimum_required(VERSION 3.19)

set(CMAKE_TOOLCHAIN_FILE "$ENV{SCE_PSP2_SDK_DIR}/host_tools/build/cmake/psp2-snc-toolchain.cmake")

project(moonshine LANGUAGES C CXX)

include(VitaDevelopmentSuite)
enable_language(EMD)
set(CMAKE_C_STANDARD 99)
set(CMAKE_CXX_STANDARD 11)

add_compile_options(
  -Xdiag=2 -Xquit=2
)

add_link_options(
  --prx-no-runtime-support
  --strip-duplicates
  --strip-unused-data
  --strip-report=strip-report.txt
)

include_directories(SYSTEM
  ${VDSUITE_USER_INCLUDE_DIRECTORIES}
)

link_directories(
  ${VDSUITE_LIBRARY_DIRECTORIES}
)

# Build self

add_compile_definitions(
  SCE_DBG_LOG_COMPONENT="\\033[0;33;1mMoonshine\\033[0m"
  SCE_DBG_LOGGING_ENABLED=$<IF:$<CONFIG:Release,MinSizeRel>,0,1>
)

add_library(moonshine MODULE
  moonshine.c
  moonshine.emd
  config.cpp
  opcode.c
  patch.c
)

target_link_libraries(moonshine
  taihen_stub
  SceIniFileProcessor_stub_weak
  SceKernel_stub
  $<$<NOT:$<CONFIG:Release,MinSizeRel>>:SceDbg_stub>
)

VDSuiteSignElf(moonshine.suprx moonshine)