mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-05-27 20:32:55 +00:00
86 lines
1.9 KiB
Meson
86 lines
1.9 KiB
Meson
# Source lists live in common_sources.txt / linux_sources.txt and are
|
|
# 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(fs.read('linux_sources.txt').strip().split('\n'))
|
|
endif
|
|
|
|
client_dependencies = []
|
|
|
|
# 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 = []
|
|
if mimalloc_dep.found()
|
|
client_dependencies += mimalloc_dep
|
|
client_link_args += ['-Wl,--no-as-needed']
|
|
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
|
|
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: '',
|
|
)
|
|
|
|
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,
|
|
)
|