mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-06-01 22:52:53 +00:00
rework build system dependencies
Some checks are pending
Some checks are pending
This commit is contained in:
parent
347265c362
commit
abeead819e
114
meson.build
114
meson.build
|
|
@ -1,17 +1,20 @@
|
|||
# MARK: build configuration
|
||||
|
||||
project(
|
||||
'4jcraft',
|
||||
['cpp', 'c'],
|
||||
version: '0.1.0',
|
||||
meson_version: '>= 1.3',
|
||||
default_options: [
|
||||
'cpp_std=c++23',
|
||||
'warning_level=0',
|
||||
'unity=on', # merge source files per target
|
||||
'unity_size=8', # TODO: mess around with this
|
||||
'b_pch=true', # precompiled headers
|
||||
'b_lto=true', # link-time optimisation (ThinLTO under clang+lld)
|
||||
'b_ndebug=if-release', # drop assert() in --buildtype=release
|
||||
],
|
||||
'4jcraft',
|
||||
['cpp', 'c'],
|
||||
version: '0.1.0',
|
||||
meson_version: '>= 1.3',
|
||||
default_options: [
|
||||
'cpp_std=c++23',
|
||||
'warning_level=0',
|
||||
'unity=on', # merge source files per target
|
||||
'unity_size=8', # TODO: mess around with this
|
||||
'buildtype=debugoptimized', # needed for _FORTIFY_SOURCE
|
||||
'b_pch=true', # precompiled headers
|
||||
'b_lto=true', # link-time optimisation (ThinLTO under clang+lld)
|
||||
'b_ndebug=if-release', # drop assert() in --buildtype=release
|
||||
],
|
||||
)
|
||||
|
||||
pymod = import('python')
|
||||
|
|
@ -19,36 +22,30 @@ python = pymod.find_installation('python3', required: true)
|
|||
|
||||
cc = meson.get_compiler('cpp')
|
||||
|
||||
global_cpp_args = ['-Wshift-count-overflow', '-pipe']
|
||||
global_cpp_defs = [
|
||||
'-DSPLIT_SAVES',
|
||||
'-D_LARGE_WORLDS',
|
||||
'-D_EXTENDED_ACHIEVEMENTS',
|
||||
'-D_FORTIFY_SOURCE=2',
|
||||
'-DMULTITHREAD_ENABLE', # always-on threading flag (formerly in App_Defines.h)
|
||||
'-DSPLIT_SAVES',
|
||||
'-D_LARGE_WORLDS',
|
||||
'-D_EXTENDED_ACHIEVEMENTS',
|
||||
'-D_FORTIFY_SOURCE=2',
|
||||
'-DMULTITHREAD_ENABLE', # always-on threading flag (formerly in App_Defines.h)
|
||||
]
|
||||
|
||||
# Debug-only defines: keep for debug + debugoptimized so iteration is unchanged.
|
||||
# --buildtype=release strips them so shipping builds don't carry debug logging,
|
||||
# debug menu UI, or assert-driven sanity checks.
|
||||
if get_option('buildtype') in ['debug', 'debugoptimized']
|
||||
global_cpp_defs += [
|
||||
'-D_DEBUG',
|
||||
'-DDEBUG',
|
||||
'-D_DEBUG_MENUS_ENABLED',
|
||||
]
|
||||
global_cpp_defs += [
|
||||
'-D_DEBUG',
|
||||
'-DDEBUG',
|
||||
'-D_DEBUG_MENUS_ENABLED',
|
||||
]
|
||||
endif
|
||||
|
||||
if get_option('renderer') == 'gles'
|
||||
global_cpp_defs += ['-DGLES']
|
||||
gl_dep = dependency('glesv2', required: true)
|
||||
glu_dep = dependency('', required: false)
|
||||
else
|
||||
gl_dep = dependency('gl', required: true)
|
||||
glu_dep = dependency('glu', required: true)
|
||||
endif
|
||||
# MARK: meson options
|
||||
|
||||
if get_option('enable_vsync')
|
||||
global_cpp_defs += ['-DENABLE_VSYNC']
|
||||
global_cpp_defs += ['-DENABLE_VSYNC']
|
||||
endif
|
||||
|
||||
if get_option('classic_panorama')
|
||||
|
|
@ -56,45 +53,52 @@ if get_option('classic_panorama')
|
|||
endif
|
||||
|
||||
if get_option('enable_frame_profiler')
|
||||
global_cpp_defs += ['-DENABLE_FRAME_PROFILER']
|
||||
global_cpp_defs += ['-DENABLE_FRAME_PROFILER']
|
||||
endif
|
||||
|
||||
if get_option('ui_backend') == 'shiggy'
|
||||
global_cpp_defs += ['-D_ENABLEIGGY']
|
||||
global_cpp_defs += ['-D_ENABLEIGGY']
|
||||
endif
|
||||
|
||||
if get_option('ui_backend') == 'java'
|
||||
global_cpp_defs += '-DENABLE_JAVA_GUIS'
|
||||
global_cpp_defs += '-DENABLE_JAVA_GUIS'
|
||||
endif
|
||||
|
||||
if get_option('occlusion_culling') == 'off'
|
||||
global_cpp_defs += ['-DOCCLUSION_MODE_NONE']
|
||||
elif get_option('occlusion_culling') == 'frustum'
|
||||
global_cpp_defs += ['-DOCCLUSION_MODE_FRUSTUM']
|
||||
elif get_option('occlusion_culling') == 'bfs'
|
||||
global_cpp_defs += ['-DOCCLUSION_MODE_BFS', '-DUSE_OCCLUSION_CULLING']
|
||||
elif get_option('occlusion_culling') == 'hardware'
|
||||
global_cpp_defs += ['-DOCCLUSION_MODE_HARDWARE', '-DUSE_OCCLUSION_CULLING']
|
||||
endif
|
||||
|
||||
add_project_arguments(global_cpp_defs, language: ['cpp', 'c'])
|
||||
|
||||
global_cpp_args = [
|
||||
'-Wshift-count-overflow',
|
||||
'-pipe',
|
||||
]
|
||||
add_project_arguments(global_cpp_args, language: 'cpp')
|
||||
|
||||
sdl2_dep = dependency('sdl2')
|
||||
thread_dep = dependency('threads')
|
||||
dl_dep = cc.find_library('dl', required: true)
|
||||
glm_dep = dependency('glm')
|
||||
|
||||
stb = subproject('stb').get_variable('stb_inc')
|
||||
stb_dep = declare_dependency(include_directories: stb)
|
||||
simdutf_dep = dependency('simdutf',
|
||||
fallback: ['simdutf', 'simdutf_dep'],
|
||||
default_options: ['utf8=true', 'utf16=true', 'utf32=true']
|
||||
)
|
||||
miniaudio_dep = dependency('miniaudio')
|
||||
|
||||
mimalloc_dep = cc.find_library('mimalloc', required: get_option('enable_mimalloc'))
|
||||
|
||||
subdir('targets/util')
|
||||
subdir('targets/java')
|
||||
subdir('targets/nbt')
|
||||
subdir('targets/platform')
|
||||
|
||||
# MARK: platform configuration
|
||||
|
||||
if host_machine.system() == 'linux'
|
||||
platform_fs_dep = platform_fs_std_dep
|
||||
platform_game_dep = platform_game_stub_dep
|
||||
platform_input_dep = platform_input_sdl2_dep
|
||||
platform_leaderboard_dep = platform_leaderboard_stub_dep
|
||||
platform_network_dep = platform_network_stub_dep
|
||||
platform_profile_dep = platform_profile_stub_dep
|
||||
platform_renderer_dep = platform_renderer_gl_dep
|
||||
platform_sound_dep = platform_sound_miniaudio_dep
|
||||
platform_storage_dep = platform_storage_stub_dep
|
||||
platform_thread_dep = platform_thread_dep # standardized backend (for now)
|
||||
|
||||
app_platform_sources = files('targets/app/linux/main.cpp')
|
||||
endif
|
||||
|
||||
subdir('targets/resources')
|
||||
subdir('targets/minecraft')
|
||||
subdir('targets/app')
|
||||
|
|
|
|||
|
|
@ -3,7 +3,3 @@ c = 'clang'
|
|||
cpp = 'clang++'
|
||||
c_ld = 'lld'
|
||||
cpp_ld = 'lld'
|
||||
|
||||
[built-in options]
|
||||
cpp_args = ['-stdlib=libc++']
|
||||
cpp_link_args = ['-stdlib=libc++']
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
project('stb', 'c')
|
||||
|
||||
stb_inc = include_directories('.')
|
||||
stb_dep = declare_dependency(
|
||||
include_directories: include_directories('.'),
|
||||
)
|
||||
|
||||
meson.override_dependency('stb', stb_dep)
|
||||
|
|
@ -240,7 +240,7 @@ int32_t DLCController::registerDLCData(char* pType, char* pBannerName,
|
|||
pDLCData->uiSortIndex = uiSortIndex;
|
||||
pDLCData->iConfig = iConfig;
|
||||
|
||||
if (strcmp(!pBannerName, "") != 0) {
|
||||
if (strcmp(pBannerName, "") != 0) {
|
||||
strncpy(pDLCData->wchBanner, pBannerName, MAX_BANNERNAME_SIZE);
|
||||
}
|
||||
if (pDataFile[0] != 0) {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
#include "app/common/Iggy/include/iggy.h"
|
||||
#include "app/common/UI/All Platforms/UIStructs.h"
|
||||
#include "platform/renderer/renderer.h"
|
||||
#include "renderer/gl/gl_compat.h"
|
||||
#include "platform/stubs.h"
|
||||
#ifndef _ENABLEIGGY
|
||||
#include "app/common/Iggy/iggy_stubs.h"
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -2,83 +2,73 @@
|
|||
# regenerated by scripts/list_sources.py whenever files are added or
|
||||
# removed.
|
||||
fs = import('fs')
|
||||
platform_sources = files(fs.read('common_sources.txt').strip().split('\n'))
|
||||
|
||||
if host_machine.system() == 'linux'
|
||||
platform_sources += files('linux/main.cpp')
|
||||
endif
|
||||
|
||||
client_dependencies = []
|
||||
app_common_sources = files(fs.read('common_sources.txt').strip().split('\n'))
|
||||
app_dependencies = []
|
||||
app_link_args = []
|
||||
|
||||
# mimalloc must come first so the linker resolves malloc/free symbols to it
|
||||
# before glibc. --no-as-needed prevents the linker from dropping it as
|
||||
# "unreferenced" (the override happens via weak symbols, not direct calls).
|
||||
client_link_args = []
|
||||
mimalloc_dep = dependency('mimalloc', required: get_option('enable_mimalloc'))
|
||||
if mimalloc_dep.found()
|
||||
client_dependencies += mimalloc_dep
|
||||
client_link_args += ['-Wl,--no-as-needed']
|
||||
app_dependencies += mimalloc_dep
|
||||
endif
|
||||
|
||||
client_dependencies += [
|
||||
java_dep,
|
||||
nbt_dep,
|
||||
render_dep,
|
||||
input_dep,
|
||||
profile_dep,
|
||||
storage_dep,
|
||||
fs_dep,
|
||||
sound_dep,
|
||||
assets_localisation_dep,
|
||||
platform_dep,
|
||||
minecraft_dep,
|
||||
gl_dep,
|
||||
glu_dep,
|
||||
thread_dep,
|
||||
dl_dep,
|
||||
dependency('zlib'),
|
||||
miniaudio_dep,
|
||||
stb_dep,
|
||||
simdutf_dep,
|
||||
util_dep,
|
||||
]
|
||||
|
||||
if get_option('ui_backend') == 'shiggy'
|
||||
shiggy_dep = dependency(
|
||||
'shiggy',
|
||||
fallback: ['shiggy', 'shiggy_dep'],
|
||||
)
|
||||
client_dependencies += shiggy_dep
|
||||
app_dependencies += dependency(
|
||||
'shiggy',
|
||||
fallback: ['shiggy', 'shiggy_dep'],
|
||||
)
|
||||
endif
|
||||
|
||||
client = executable(
|
||||
'Minecraft.Client',
|
||||
platform_sources + localisation[1],
|
||||
include_directories: include_directories('..'),
|
||||
dependencies: client_dependencies,
|
||||
cpp_args: global_cpp_args
|
||||
+ global_cpp_defs
|
||||
+ [
|
||||
'-DUNICODE',
|
||||
'-D_UNICODE',
|
||||
],
|
||||
c_args: global_cpp_defs + ['-DUNICODE', '-D_UNICODE'],
|
||||
link_args: client_link_args,
|
||||
install: true,
|
||||
install_dir: '',
|
||||
app_dependencies += [
|
||||
dependency('dl'), # blame iggy gdraw, nuke this later
|
||||
dependency('sdl2'), # blame iggy gdraw, nuke this later
|
||||
dependency('miniaudio'), # todo: remove once PlatformSound is used
|
||||
dependency('stb'),
|
||||
dependency('simdutf'),
|
||||
java_dep,
|
||||
nbt_dep,
|
||||
util_dep,
|
||||
minecraft_dep,
|
||||
assets_localisation_dep,
|
||||
platform_fs_dep,
|
||||
platform_game_dep,
|
||||
platform_input_dep,
|
||||
platform_leaderboard_dep,
|
||||
platform_network_dep,
|
||||
platform_profile_dep,
|
||||
platform_renderer_dep,
|
||||
platform_sound_dep,
|
||||
platform_storage_dep,
|
||||
platform_thread_dep,
|
||||
# technically also GL/EGL, but the GL renderer needs to not leak GL shit to fix that
|
||||
]
|
||||
|
||||
app = executable(
|
||||
'Minecraft.Client',
|
||||
app_common_sources + app_platform_sources + localisation[1],
|
||||
include_directories: include_directories('..'),
|
||||
dependencies: app_dependencies,
|
||||
cpp_args: global_cpp_args + global_cpp_defs,
|
||||
link_args: app_link_args,
|
||||
install: true,
|
||||
install_dir: '',
|
||||
)
|
||||
|
||||
custom_target(
|
||||
'copy_assets_to_client',
|
||||
input: [client, media_archive],
|
||||
output: 'assets.stamp',
|
||||
command: [
|
||||
python,
|
||||
meson.project_source_root() / 'scripts/copy_assets_to_client.py',
|
||||
meson.project_source_root(),
|
||||
meson.project_build_root(),
|
||||
meson.current_build_dir(),
|
||||
'@INPUT1@',
|
||||
'@OUTPUT@',
|
||||
],
|
||||
build_by_default: true,
|
||||
'copy_assets_to_app',
|
||||
input: [app, media_archive],
|
||||
output: 'assets.stamp',
|
||||
command: [
|
||||
python,
|
||||
meson.project_source_root() / 'scripts/copy_assets_to_app.py',
|
||||
meson.project_source_root(),
|
||||
meson.project_build_root(),
|
||||
meson.current_build_dir(),
|
||||
'@INPUT1@',
|
||||
'@OUTPUT@',
|
||||
],
|
||||
build_by_default: true,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "PlatformTypes.h"
|
||||
#include "platform/PlatformTypes.h"
|
||||
#include "minecraft/IGameServices.h"
|
||||
#include "platform/fs/fs.h"
|
||||
#include "platform/renderer/renderer.h"
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
#include "minecraft/world/item/Item.h"
|
||||
#include "minecraft/world/level/tile/Tile.h"
|
||||
// 4J Stu - Added for tutorial callbacks
|
||||
#include "PlatformTypes.h"
|
||||
#include "platform/PlatformTypes.h"
|
||||
#include "Pos.h"
|
||||
#include "app/common/Audio/ConsoleSoundEngine.h"
|
||||
#include "app/common/Audio/SoundTypes.h"
|
||||
|
|
|
|||
|
|
@ -2,49 +2,32 @@
|
|||
# scripts/list_sources.py whenever files are added or removed. Reading
|
||||
# the committed file means meson reconfigures only when the list itself
|
||||
# changes, which is what we want.
|
||||
|
||||
fs = import('fs')
|
||||
minecraft_sources = files(fs.read('sources.txt').strip().split('\n'))
|
||||
|
||||
occlusion_mode = get_option('occlusion_culling')
|
||||
if occlusion_mode == 'off'
|
||||
global_cpp_defs += ['-DOCCLUSION_MODE_NONE']
|
||||
elif occlusion_mode == 'frustum'
|
||||
global_cpp_defs += ['-DOCCLUSION_MODE_FRUSTUM']
|
||||
elif occlusion_mode == 'bfs'
|
||||
global_cpp_defs += ['-DOCCLUSION_MODE_BFS', '-DUSE_OCCLUSION_CULLING']
|
||||
elif occlusion_mode == 'hardware'
|
||||
global_cpp_defs += ['-DOCCLUSION_MODE_HARDWARE', '-DUSE_OCCLUSION_CULLING']
|
||||
endif
|
||||
|
||||
if get_option('ui_backend') == 'java'
|
||||
global_cpp_defs += '-DENABLE_JAVA_GUIS'
|
||||
endif
|
||||
|
||||
lib_minecraft = static_library('minecraft',
|
||||
minecraft_sources,
|
||||
dependencies : [
|
||||
sound_dep,
|
||||
render_dep,
|
||||
input_dep,
|
||||
profile_dep,
|
||||
storage_dep,
|
||||
fs_dep,
|
||||
glm_dep,
|
||||
nbt_dep,
|
||||
java_dep,
|
||||
assets_localisation_dep,
|
||||
platform_dep,
|
||||
util_dep,
|
||||
dependency('zlib'),
|
||||
],
|
||||
include_directories : include_directories('..'),
|
||||
cpp_args : global_cpp_args + global_cpp_defs,
|
||||
)
|
||||
|
||||
zlib_dep = dependency('zlib')
|
||||
crypto_dep = dependency('libcrypto') # for MD5 in Hasher.cpp on Linux
|
||||
|
||||
minecraft_dep = declare_dependency(
|
||||
link_with : lib_minecraft,
|
||||
dependencies : [crypto_dep, zlib_dep],
|
||||
lib_minecraft = static_library('minecraft',
|
||||
minecraft_sources,
|
||||
dependencies : [
|
||||
dependency('libcrypto'), # for MD5 in Hasher.cpp on Linux
|
||||
dependency('zlib'),
|
||||
dependency('glm'),
|
||||
nbt_dep,
|
||||
java_dep,
|
||||
util_dep,
|
||||
assets_localisation_dep,
|
||||
platform_sound_dep,
|
||||
platform_renderer_dep,
|
||||
platform_input_dep,
|
||||
platform_profile_dep,
|
||||
platform_storage_dep,
|
||||
platform_fs_dep,
|
||||
platform_thread_dep,
|
||||
],
|
||||
include_directories : include_directories('..'),
|
||||
cpp_args : global_cpp_args + global_cpp_defs,
|
||||
)
|
||||
|
||||
minecraft_dep = declare_dependency(link_with : lib_minecraft)
|
||||
|
|
|
|||
|
|
@ -1522,8 +1522,8 @@ Player::BedSleepingResult Player::startSleepInBed(int x, int y, int z,
|
|||
// use the bed in daytime from far away and you'll get the message about
|
||||
// only sleeping at night
|
||||
|
||||
if (abs(this->x - x) > 3 || abs(this->y - y) > 2 ||
|
||||
abs(this->z - z) > 3) {
|
||||
if (std::abs(this->x - x) > 3 || std::abs(this->y - y) > 2 ||
|
||||
std::abs(this->z - z) > 3) {
|
||||
// too far away
|
||||
return TOO_FAR_AWAY;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include <wchar.h>
|
||||
|
||||
#include "PlatformTypes.h"
|
||||
#include "platform/PlatformTypes.h"
|
||||
#include "minecraft/client/Minecraft.h"
|
||||
#include "minecraft/network/packet/SignUpdatePacket.h"
|
||||
#include "minecraft/server/level/ServerLevel.h"
|
||||
|
|
|
|||
|
|
@ -1 +1,9 @@
|
|||
platform_fs_sources = files('std/StdFilesystem.cpp')
|
||||
lib_platform_fs_std = static_library('platform_fs_std',
|
||||
files('std/StdFilesystem.cpp'),
|
||||
include_directories: include_directories('../../'),
|
||||
cpp_args: global_cpp_args + global_cpp_defs,
|
||||
)
|
||||
|
||||
platform_fs_std_dep = declare_dependency(
|
||||
link_with: lib_platform_fs_std,
|
||||
)
|
||||
|
|
@ -1 +1,9 @@
|
|||
platform_game_sources = files('stub/StubPlatformGame.cpp')
|
||||
lib_platform_game_stub = static_library('platform_game_stub',
|
||||
files('stub/StubPlatformGame.cpp'),
|
||||
include_directories: include_directories('../../'),
|
||||
cpp_args: global_cpp_args + global_cpp_defs,
|
||||
)
|
||||
|
||||
platform_game_stub_dep = declare_dependency(
|
||||
link_with: lib_platform_game_stub,
|
||||
)
|
||||
|
|
@ -2,8 +2,7 @@
|
|||
|
||||
#include <functional>
|
||||
|
||||
#include "InputConstants.h"
|
||||
#include "PlatformTypes.h"
|
||||
#include "platform/PlatformTypes.h"
|
||||
|
||||
class IPlatformInput {
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "IPlatformInput.h"
|
||||
#include "InputConstants.h"
|
||||
|
||||
// Function accessor backed by a function-local static (Meyers singleton).
|
||||
// Avoids the static-initialization-order fiasco that the previous
|
||||
|
|
|
|||
|
|
@ -1 +1,10 @@
|
|||
platform_input_sources = files('sdl2/SDL2Input.cpp')
|
||||
lib_platform_input_sdl2 = static_library('platform_input_sdl2',
|
||||
files('sdl2/SDL2Input.cpp'),
|
||||
dependencies: dependency('sdl2'),
|
||||
include_directories: include_directories('../../'),
|
||||
cpp_args: global_cpp_args + global_cpp_defs,
|
||||
)
|
||||
|
||||
platform_input_sdl2_dep = declare_dependency(
|
||||
link_with: lib_platform_input_sdl2,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
#include "SDL2Input.h"
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include <SDL2/SDL_events.h>
|
||||
#include <SDL2/SDL_gamecontroller.h>
|
||||
#include <SDL2/SDL_joystick.h>
|
||||
#include <SDL2/SDL_keyboard.h>
|
||||
#include <SDL2/SDL_mouse.h>
|
||||
#include <SDL2/SDL_scancode.h>
|
||||
#include <SDL2/SDL_stdinc.h>
|
||||
#include <SDL2/SDL_video.h>
|
||||
#include <SDL2/begin_code.h>
|
||||
#include "SDL2/SDL.h"
|
||||
#include "SDL2/SDL_events.h"
|
||||
#include "SDL2/SDL_gamecontroller.h"
|
||||
#include "SDL2/SDL_joystick.h"
|
||||
#include "SDL2/SDL_keyboard.h"
|
||||
#include "SDL2/SDL_mouse.h"
|
||||
#include "SDL2/SDL_scancode.h"
|
||||
#include "SDL2/SDL_stdinc.h"
|
||||
#include "SDL2/SDL_video.h"
|
||||
#include "SDL2/begin_code.h"
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include "../IPlatformInput.h"
|
||||
|
||||
class SDL2Input : public IPlatformInput {
|
||||
|
|
|
|||
|
|
@ -1 +1,9 @@
|
|||
platform_leaderboard_sources = files('stub/StubLeaderboard.cpp')
|
||||
lib_platform_leaderboard_stub = static_library('platform_leaderboard_stub',
|
||||
files('stub/StubLeaderboard.cpp'),
|
||||
include_directories: include_directories('../../'),
|
||||
cpp_args: global_cpp_args + global_cpp_defs,
|
||||
)
|
||||
|
||||
platform_leaderboard_stub_dep = declare_dependency(
|
||||
link_with: lib_platform_leaderboard_stub,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,76 +1,10 @@
|
|||
platform_inc = include_directories('.')
|
||||
_threads = dependency('threads')
|
||||
_sdl2 = dependency('sdl2')
|
||||
|
||||
if get_option('renderer') == 'gles'
|
||||
_gl = dependency('glesv2', required: true)
|
||||
_defs = ['-DGLES']
|
||||
else
|
||||
_gl = dependency('gl', required: true)
|
||||
_defs = []
|
||||
endif
|
||||
|
||||
# Per-subsystem source lists. Each subdir owns its own list of backend
|
||||
# .cpp files via a `platform_<name>_sources` variable. The library
|
||||
# build is centralised so we get one library per platform target rather
|
||||
# than one per subsystem; subsystems vary together (an SDL2 platform
|
||||
# wants SDL2 input + GL renderer + miniaudio together) and a per-
|
||||
# subsystem split inflates link units without buying flexibility.
|
||||
subdir('input')
|
||||
subdir('profile')
|
||||
subdir('storage')
|
||||
subdir('fs')
|
||||
subdir('game')
|
||||
subdir('input')
|
||||
subdir('leaderboard')
|
||||
subdir('network')
|
||||
subdir('profile')
|
||||
subdir('renderer')
|
||||
subdir('sound')
|
||||
subdir('network')
|
||||
subdir('leaderboard')
|
||||
subdir('game')
|
||||
subdir('storage')
|
||||
subdir('thread')
|
||||
|
||||
# Core: thread + shutdown plumbing, no backend.
|
||||
lib_platform_core = static_library('platform_core',
|
||||
platform_thread_sources,
|
||||
include_directories: [platform_inc, include_directories('..')],
|
||||
dependencies: [_threads],
|
||||
cpp_args: global_cpp_args + global_cpp_defs,
|
||||
)
|
||||
|
||||
platform_dep = declare_dependency(
|
||||
link_with: lib_platform_core,
|
||||
include_directories: platform_inc,
|
||||
)
|
||||
|
||||
lib_platform_sdl2 = static_library('platform_sdl2',
|
||||
platform_input_sources
|
||||
+ platform_profile_sources
|
||||
+ platform_storage_sources
|
||||
+ platform_fs_sources
|
||||
+ platform_renderer_sources
|
||||
+ platform_sound_sources
|
||||
+ platform_network_sources
|
||||
+ platform_leaderboard_sources
|
||||
+ platform_game_sources,
|
||||
include_directories: [platform_inc, include_directories('..')],
|
||||
dependencies: [_sdl2, _gl, _threads, glm_dep, stb_dep, java_dep,
|
||||
miniaudio_dep],
|
||||
cpp_args: _defs + global_cpp_args + global_cpp_defs,
|
||||
)
|
||||
|
||||
# Single dep for the whole platform_sdl2 library. Aliased per-subsystem
|
||||
# so consumer meson files can keep asking for `input_dep` etc. without
|
||||
# caring that they all resolve to the same library object today.
|
||||
platform_sdl2_dep = declare_dependency(
|
||||
link_with: lib_platform_sdl2,
|
||||
include_directories: [platform_inc],
|
||||
dependencies: [_sdl2, _gl, _threads, glm_dep, miniaudio_dep],
|
||||
)
|
||||
|
||||
input_dep = platform_sdl2_dep
|
||||
profile_dep = platform_sdl2_dep
|
||||
storage_dep = platform_sdl2_dep
|
||||
fs_dep = platform_sdl2_dep
|
||||
render_dep = platform_sdl2_dep
|
||||
sound_dep = platform_sdl2_dep
|
||||
network_dep = platform_sdl2_dep
|
||||
leaderboard_dep = platform_sdl2_dep
|
||||
game_dep = platform_sdl2_dep
|
||||
|
|
|
|||
|
|
@ -1 +1,10 @@
|
|||
platform_network_sources = files('stub/StubPlatformNetwork.cpp', 'stub/StubNetworkPlayer.cpp')
|
||||
lib_platform_network_stub = static_library('platform_network_stub',
|
||||
files('stub/StubNetworkPlayer.cpp', 'stub/StubPlatformNetwork.cpp'),
|
||||
include_directories: include_directories('../../'),
|
||||
dependencies: java_dep,
|
||||
cpp_args: global_cpp_args + global_cpp_defs,
|
||||
)
|
||||
|
||||
platform_network_stub_dep = declare_dependency(
|
||||
link_with: lib_platform_network_stub,
|
||||
)
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
#include <functional>
|
||||
#include <string>
|
||||
|
||||
#include "PlatformTypes.h"
|
||||
#include "platform/PlatformTypes.h"
|
||||
|
||||
class CXuiStringTable;
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1,11 @@
|
|||
platform_profile_sources = files('stub/StubProfile.cpp')
|
||||
platform_profile_stub_sources = files('stub/StubProfile.cpp')
|
||||
|
||||
lib_platform_profile_stub = static_library('platform_profile_stub',
|
||||
files('stub/StubProfile.cpp'),
|
||||
include_directories: include_directories('../../'),
|
||||
cpp_args: global_cpp_args + global_cpp_defs,
|
||||
)
|
||||
|
||||
platform_profile_stub_dep = declare_dependency(
|
||||
link_with: lib_platform_profile_stub,
|
||||
)
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
#include <functional>
|
||||
|
||||
#include "../ProfileConstants.h"
|
||||
#include "input/input.h"
|
||||
#include "platform/input/input.h"
|
||||
|
||||
namespace platform_internal {
|
||||
IPlatformProfile& PlatformProfile_get() {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
#include <string>
|
||||
|
||||
#include "../IPlatformProfile.h"
|
||||
#include "PlatformTypes.h"
|
||||
#include "platform/PlatformTypes.h"
|
||||
|
||||
class StubProfile : public IPlatformProfile {
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include <cstdint>
|
||||
|
||||
#include "PlatformTypes.h"
|
||||
#include "platform/PlatformTypes.h"
|
||||
|
||||
class IPlatformRenderer {
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include "GLRenderer.h"
|
||||
|
||||
#include "PlatformTypes.h"
|
||||
#include "platform/PlatformTypes.h"
|
||||
#include "SDL.h"
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_events.h"
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
#include "java/ByteBuffer.h"
|
||||
#include "java/FloatBuffer.h"
|
||||
#include "java/IntBuffer.h"
|
||||
#include "renderer/renderer.h"
|
||||
#include "platform/renderer/renderer.h"
|
||||
|
||||
// undefine macros from header to avoid argument mismatch
|
||||
#undef glGenTextures
|
||||
|
|
@ -41,15 +41,15 @@
|
|||
#include "stb_image.h"
|
||||
|
||||
#define GLM_FORCE_RADIANS
|
||||
#include "glm/glm.hpp"
|
||||
#include "glm/gtc/matrix_transform.hpp"
|
||||
#include "glm/gtc/type_ptr.hpp"
|
||||
|
||||
#include <dlfcn.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#include <cmath>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <glm/glm.hpp>
|
||||
#include <glm/gtc/matrix_transform.hpp>
|
||||
#include <glm/gtc/type_ptr.hpp>
|
||||
#include <unordered_map>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
|
|
|||
|
|
@ -6,9 +6,8 @@
|
|||
#include <GL/glu.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "renderer/IPlatformRenderer.h"
|
||||
#include "platform/renderer/IPlatformRenderer.h"
|
||||
|
||||
extern IPlatformRenderer& PlatformRenderer;
|
||||
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@
|
|||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "renderer/IPlatformRenderer.h"
|
||||
#include "renderer/renderer.h"
|
||||
#include "platform/renderer/IPlatformRenderer.h"
|
||||
#include "platform/renderer/renderer.h"
|
||||
|
||||
// OpenGL Interception Macros
|
||||
#ifndef GL_MODELVIEW_MATRIX
|
||||
|
|
|
|||
|
|
@ -1 +1,27 @@
|
|||
platform_renderer_sources = files('gl/GLRenderer.cpp', 'gl/render_stubs.cpp')
|
||||
platform_renderer_gl_dependencies = [
|
||||
dependency('dl'),
|
||||
dependency('sdl2'),
|
||||
dependency('glm'),
|
||||
dependency('stb'),
|
||||
java_dep,
|
||||
]
|
||||
platform_renderer_gl_defs = []
|
||||
|
||||
if get_option('renderer') == 'gles'
|
||||
platform_renderer_gl_dependencies += dependency('glesv2')
|
||||
platform_renderer_gl_defs = ['-DGLES']
|
||||
else
|
||||
platform_renderer_gl_dependencies += dependency('gl')
|
||||
platform_renderer_gl_defs = []
|
||||
endif
|
||||
|
||||
lib_platform_renderer_gl = static_library('platform_renderer_gl',
|
||||
files('gl/GLRenderer.cpp', 'gl/render_stubs.cpp'),
|
||||
include_directories: include_directories('../../'),
|
||||
dependencies: platform_renderer_gl_dependencies,
|
||||
cpp_args: platform_renderer_gl_defs + global_cpp_args + global_cpp_defs,
|
||||
)
|
||||
|
||||
platform_renderer_gl_dep = declare_dependency(
|
||||
link_with: lib_platform_renderer_gl,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1 +1,10 @@
|
|||
platform_sound_sources = files('miniaudio/MiniaudioSound.cpp')
|
||||
lib_platform_sound_miniaudio = static_library('platform_sound_miniaudio',
|
||||
files('miniaudio/MiniaudioSound.cpp'),
|
||||
dependencies: dependency('miniaudio'),
|
||||
include_directories: include_directories('../../'),
|
||||
cpp_args: global_cpp_args + global_cpp_defs,
|
||||
)
|
||||
|
||||
platform_sound_miniaudio_dep = declare_dependency(
|
||||
link_with: lib_platform_sound_miniaudio,
|
||||
)
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "PlatformTypes.h"
|
||||
#include "platform/PlatformTypes.h"
|
||||
|
||||
#define MAX_DISPLAYNAME_LENGTH 128 // CELL_SAVEDATA_SYSP_SUBTITLE_SIZE on PS3
|
||||
#define MAX_DETAILS_LENGTH 128 // CELL_SAVEDATA_SYSP_SUBTITLE_SIZE on PS3
|
||||
|
|
|
|||
|
|
@ -1 +1,9 @@
|
|||
platform_storage_sources = files('stub/StubStorage.cpp')
|
||||
lib_platform_storage_stub = static_library('platform_storage_stub',
|
||||
files('stub/StubStorage.cpp'),
|
||||
include_directories: include_directories('../../'),
|
||||
cpp_args: global_cpp_args + global_cpp_defs,
|
||||
)
|
||||
|
||||
platform_storage_stub_dep = declare_dependency(
|
||||
link_with: lib_platform_storage_stub,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// #include <xtms.h>
|
||||
|
||||
#include "../IPlatformStorage.h"
|
||||
#include "PlatformTypes.h"
|
||||
#include "platform/PlatformTypes.h"
|
||||
|
||||
class C4JStringTable;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
#include <GL/gl.h>
|
||||
#include <GL/glu.h>
|
||||
|
||||
#include <string>
|
||||
#include <string.h>
|
||||
|
||||
#include "java/File.h"
|
||||
#include "renderer/gl/gl_compat.h"
|
||||
|
|
|
|||
|
|
@ -1 +1,10 @@
|
|||
platform_thread_sources = files('C4JThread.cpp', 'ShutdownManager.cpp')
|
||||
lib_platform_thread = static_library('platform_thread',
|
||||
files('C4JThread.cpp', 'ShutdownManager.cpp'),
|
||||
dependencies: [dependency('threads')],
|
||||
include_directories: include_directories('../../'),
|
||||
cpp_args: global_cpp_args + global_cpp_defs,
|
||||
)
|
||||
|
||||
platform_thread_dep = declare_dependency(
|
||||
link_with: lib_platform_thread,
|
||||
)
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
lib_util = static_library('util',
|
||||
files('StringHelpers.cpp', 'FrameProfiler.cpp'),
|
||||
dependencies: [simdutf_dep],
|
||||
dependencies: [dependency('simdutf')],
|
||||
include_directories : include_directories('.', '..'),
|
||||
cpp_args : global_cpp_args + global_cpp_defs,
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue