4jcraft/targets/minecraft/meson.build

51 lines
1.4 KiB
Meson

# Source list lives in sources.txt and is regenerated by
# 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],
)