forked from RSDKModding/RSDKv5-Decompilation
-
Notifications
You must be signed in to change notification settings - Fork 6
/
NintendoWii.cmake
64 lines (53 loc) · 2.11 KB
/
NintendoWii.cmake
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
find_package(PkgConfig REQUIRED)
add_executable(RetroEngine ${RETRO_FILES})
set(RETRO_SUBSYSTEM "GX" CACHE STRING "The subsystem to use")
if(NOT (RETRO_SUBSYSTEM STREQUAL "GX"))
message(FATAL_ERROR "RETRO_SUBSYSTEM must be set to GX")
endif()
if(NOT GAME_STATIC)
message(FATAL_ERROR "GAME_STATIC must be on")
endif()
# pkg_check_modules(OGG ogg)
#
# if(NOT OGG_FOUND)
# set(COMPILE_OGG TRUE)
# message(NOTICE "libogg not found, attempting to build from source")
# else()
# message("found libogg")
# target_link_libraries(RetroEngine ${OGG_STATIC_LIBRARIES})
# target_link_options(RetroEngine PRIVATE ${OGG_STATIC_LDLIBS_OTHER})
# target_compile_options(RetroEngine PRIVATE ${OGG_STATIC_CFLAGS})
# endif()
#
# pkg_check_modules(THEORA theora theoradec)
#
# if(NOT THEORA_FOUND)
# message("could not find libtheora, attempting to build manually")
# set(COMPILE_THEORA TRUE)
# else()
# message("found libtheora")
# target_link_libraries(RetroEngine ${THEORA_STATIC_LIBRARIES})
# target_link_options(RetroEngine PRIVATE ${THEORA_STATIC_LDLIBS_OTHER})
# target_compile_options(RetroEngine PRIVATE ${THEORA_STATIC_CFLAGS})
# endif()
set(GAME_INCLUDE_EDITOR OFF CACHE BOOL "Disable unused editor code" FORCE)
set(SHARED_COMPILE
$<$<COMPILE_LANGUAGE:CXX>:-fno-rtti -fno-threadsafe-statics>
-Os -fomit-frame-pointer -ffunction-sections -fdata-sections -fno-asynchronous-unwind-tables -fmerge-all-constants
)
set(SHARED_LINK
-Wl,-gc-sections -Wl,--strip-all -Wl,-Map,.map
)
# Lower framebuffer size and screen count to save up RAM
set(SHARED_DEFINES
SCREEN_XMAX=512 SCREEN_COUNT=1
)
target_compile_options(RetroEngine PRIVATE ${SHARED_COMPILE})
target_compile_definitions(RetroEngine PRIVATE ${SHARED_DEFINES} BASE_PATH="/RSDKv5/" RETRO_DISABLE_LOG=1)
target_link_options(RetroEngine PRIVATE ${SHARED_LINK})
target_link_libraries(RetroEngine fat aesnd)
target_compile_options(${GAME_NAME} PRIVATE ${SHARED_COMPILE})
target_compile_definitions(${GAME_NAME} PRIVATE ${SHARED_DEFINES})
target_link_options(${GAME_NAME} PRIVATE ${SHARED_LINK})
set(PLATFORM Wii)
ogc_create_dol(RetroEngine)