2020-09-25 16:43:53 +00:00
|
|
|
project(mods)
|
|
|
|
|
2021-01-27 21:26:19 +00:00
|
|
|
## Setup
|
|
|
|
|
2020-12-04 21:27:28 +00:00
|
|
|
# Disable C++11 String ABI
|
2020-10-10 23:02:13 +00:00
|
|
|
add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0)
|
2020-09-25 16:43:53 +00:00
|
|
|
|
2021-01-27 21:26:19 +00:00
|
|
|
## Mods
|
|
|
|
|
2022-03-25 02:47:34 +00:00
|
|
|
add_library(compat SHARED src/compat/compat.c src/compat/egl.c src/compat/x11.c src/compat/bcm_host.c)
|
2022-03-14 23:09:25 +00:00
|
|
|
target_link_libraries(compat reborn-patch media-layer-core)
|
2020-12-02 23:18:49 +00:00
|
|
|
|
2021-01-27 21:26:19 +00:00
|
|
|
add_library(readdir SHARED src/readdir/readdir.c)
|
2020-09-25 16:43:53 +00:00
|
|
|
|
2020-12-02 23:18:49 +00:00
|
|
|
add_library(feature SHARED src/feature/feature.c)
|
2022-03-14 23:09:25 +00:00
|
|
|
target_link_libraries(feature reborn-patch)
|
2020-12-02 23:18:49 +00:00
|
|
|
|
2021-06-28 20:00:52 +00:00
|
|
|
add_library(version SHARED src/version/version.cpp)
|
2022-03-14 23:09:25 +00:00
|
|
|
target_link_libraries(version reborn-patch symbols)
|
2021-09-12 03:18:12 +00:00
|
|
|
|
|
|
|
add_library(chat SHARED src/chat/chat.cpp src/chat/ui.c)
|
2022-03-14 23:09:25 +00:00
|
|
|
target_link_libraries(chat reborn-patch symbols feature pthread)
|
2021-06-28 20:00:52 +00:00
|
|
|
|
2022-04-10 00:01:16 +00:00
|
|
|
add_library(creative SHARED src/creative/creative.cpp)
|
|
|
|
target_link_libraries(creative reborn-patch symbols feature)
|
|
|
|
|
2021-06-17 21:32:24 +00:00
|
|
|
if(MCPI_SERVER_MODE)
|
|
|
|
add_library(server SHARED src/server/server.cpp src/server/server_properties.cpp)
|
2022-03-14 23:09:25 +00:00
|
|
|
target_link_libraries(server reborn-patch symbols feature home misc compat dl media-layer-core pthread)
|
2021-06-28 02:16:37 +00:00
|
|
|
else()
|
2021-09-12 03:18:12 +00:00
|
|
|
target_link_libraries(compat input sign chat home dl)
|
|
|
|
|
|
|
|
target_link_libraries(chat input)
|
|
|
|
|
2021-06-28 02:16:37 +00:00
|
|
|
add_library(multiplayer SHARED src/multiplayer/multiplayer.cpp)
|
2022-03-14 23:09:25 +00:00
|
|
|
target_link_libraries(multiplayer reborn-patch symbols home feature)
|
2020-11-24 22:12:23 +00:00
|
|
|
|
2021-09-12 03:18:12 +00:00
|
|
|
add_library(sound SHARED src/sound/sound.cpp src/sound/repository.cpp)
|
2022-03-14 23:09:25 +00:00
|
|
|
target_link_libraries(sound reborn-patch symbols feature override media-layer-core)
|
2020-10-04 00:30:15 +00:00
|
|
|
|
2021-09-12 03:18:12 +00:00
|
|
|
add_library(camera SHARED src/camera/camera.cpp)
|
2022-03-14 23:09:25 +00:00
|
|
|
target_link_libraries(camera reborn-patch symbols media-layer-core feature home)
|
2020-11-28 01:49:13 +00:00
|
|
|
|
2021-09-12 03:18:12 +00:00
|
|
|
add_library(input SHARED src/input/input.cpp src/input/bow.c src/input/attack.c src/input/toggle.c src/input/misc.c src/input/drop.cpp)
|
2022-03-14 23:09:25 +00:00
|
|
|
target_link_libraries(input reborn-patch symbols creative feature media-layer-core)
|
2021-06-29 02:59:24 +00:00
|
|
|
|
2021-09-12 03:18:12 +00:00
|
|
|
add_library(sign SHARED src/sign/sign.cpp)
|
2022-03-14 23:09:25 +00:00
|
|
|
target_link_libraries(sign reborn-patch symbols feature input)
|
2020-10-05 22:17:55 +00:00
|
|
|
|
2021-09-12 03:18:12 +00:00
|
|
|
add_library(touch SHARED src/touch/touch.c)
|
2022-03-14 23:09:25 +00:00
|
|
|
target_link_libraries(touch reborn-patch symbols feature)
|
2020-12-02 23:18:49 +00:00
|
|
|
|
2021-09-12 03:18:12 +00:00
|
|
|
add_library(override SHARED src/override/override.c)
|
2022-03-14 23:09:25 +00:00
|
|
|
target_link_libraries(override reborn-patch symbols dl home)
|
2021-08-06 01:00:41 +00:00
|
|
|
|
2021-09-12 03:18:12 +00:00
|
|
|
add_library(textures SHARED src/textures/textures.cpp)
|
2022-03-14 23:09:25 +00:00
|
|
|
target_link_libraries(textures reborn-patch symbols media-layer-core feature)
|
2020-12-02 23:18:49 +00:00
|
|
|
|
2021-09-12 03:18:12 +00:00
|
|
|
add_library(atlas SHARED src/atlas/atlas.cpp)
|
2022-03-14 23:09:25 +00:00
|
|
|
target_link_libraries(atlas reborn-patch symbols feature GLESv1_CM)
|
2021-11-14 04:29:48 +00:00
|
|
|
|
|
|
|
if(NOT MCPI_HEADLESS_MODE)
|
|
|
|
add_library(benchmark SHARED src/benchmark/benchmark.cpp)
|
2022-03-14 23:09:25 +00:00
|
|
|
target_link_libraries(benchmark reborn-patch symbols compat misc media-layer-core)
|
2021-11-14 04:29:48 +00:00
|
|
|
endif()
|
2021-09-12 03:18:12 +00:00
|
|
|
endif()
|
2021-06-19 23:07:09 +00:00
|
|
|
|
2021-09-12 03:18:12 +00:00
|
|
|
add_library(game-mode SHARED src/game-mode/game-mode.c src/game-mode/game-mode.cpp)
|
2022-03-14 23:09:25 +00:00
|
|
|
target_link_libraries(game-mode reborn-patch symbols feature)
|
2020-12-02 23:18:49 +00:00
|
|
|
|
2021-09-12 03:18:12 +00:00
|
|
|
add_library(death SHARED src/death/death.cpp)
|
2022-03-14 23:09:25 +00:00
|
|
|
target_link_libraries(death reborn-patch symbols feature)
|
2021-06-30 23:41:18 +00:00
|
|
|
|
2021-11-14 04:29:48 +00:00
|
|
|
add_library(misc SHARED src/misc/misc.c src/misc/misc.cpp src/misc/logging.cpp)
|
2022-03-15 01:51:38 +00:00
|
|
|
target_link_libraries(misc reborn-patch symbols media-layer-core feature GLESv1_CM)
|
2020-09-25 16:43:53 +00:00
|
|
|
|
2022-04-11 02:41:47 +00:00
|
|
|
add_library(options SHARED src/options/options.c src/options/options.cpp)
|
|
|
|
target_link_libraries(options reborn-patch symbols feature home)
|
2021-02-16 17:26:40 +00:00
|
|
|
|
2021-06-17 21:32:24 +00:00
|
|
|
add_library(home SHARED src/home/home.c)
|
2022-03-14 23:09:25 +00:00
|
|
|
target_link_libraries(home reborn-patch symbols)
|
2021-06-17 21:32:24 +00:00
|
|
|
|
2021-01-27 16:13:06 +00:00
|
|
|
add_library(test SHARED src/test/test.c)
|
2022-03-14 23:09:25 +00:00
|
|
|
target_link_libraries(test reborn-patch home)
|
2021-01-27 16:13:06 +00:00
|
|
|
|
2020-12-02 23:18:49 +00:00
|
|
|
add_library(init SHARED src/init/init.c)
|
2022-04-10 00:01:16 +00:00
|
|
|
target_link_libraries(init compat game-mode misc death options chat creative home version test media-layer-core)
|
2021-06-17 21:32:24 +00:00
|
|
|
if(MCPI_SERVER_MODE)
|
|
|
|
target_link_libraries(init server)
|
2021-06-28 02:16:37 +00:00
|
|
|
else()
|
2022-04-10 00:01:16 +00:00
|
|
|
target_link_libraries(init multiplayer sound camera input sign touch textures atlas)
|
2021-11-14 04:29:48 +00:00
|
|
|
if(NOT MCPI_HEADLESS_MODE)
|
|
|
|
target_link_libraries(init benchmark)
|
|
|
|
endif()
|
2021-06-17 21:32:24 +00:00
|
|
|
endif()
|
2021-01-27 21:26:19 +00:00
|
|
|
|
2021-02-21 19:53:17 +00:00
|
|
|
## Install Mods
|
2022-04-10 00:01:16 +00:00
|
|
|
install(TARGETS init compat readdir feature game-mode misc death options chat creative home version test DESTINATION "${MCPI_INSTALL_DIR}/mods")
|
2021-06-17 21:32:24 +00:00
|
|
|
if(MCPI_SERVER_MODE)
|
|
|
|
install(TARGETS server DESTINATION "${MCPI_INSTALL_DIR}/mods")
|
2021-06-28 02:16:37 +00:00
|
|
|
else()
|
2022-04-10 00:01:16 +00:00
|
|
|
install(TARGETS multiplayer sound override camera input sign touch textures atlas DESTINATION "${MCPI_INSTALL_DIR}/mods")
|
2021-11-14 04:29:48 +00:00
|
|
|
if(NOT MCPI_HEADLESS_MODE)
|
|
|
|
install(TARGETS benchmark DESTINATION "${MCPI_INSTALL_DIR}/mods")
|
|
|
|
endif()
|
2021-06-17 21:32:24 +00:00
|
|
|
endif()
|