Add zlib subproject

This commit is contained in:
DankParrot 2020-08-01 20:47:53 -07:00
parent 14e416b909
commit 8ac6ddfde2
4 changed files with 56 additions and 2 deletions

6
.gitmodules vendored
View File

@ -5,3 +5,9 @@
[submodule "subprojects/rapidjson"]
path = subprojects/rapidjson
url = https://github.com/Tencent/rapidjson/
[submodule "subprojects/cNBT"]
path = subprojects/cNBT
url = https://github.com/nickelpro/cNBT
[submodule "subprojects/zlib"]
path = subprojects/zlib
url = https://github.com/madler/zlib.git

View File

@ -16,6 +16,24 @@ threads_dep = dependency('threads')
cmake = import('cmake')
########################################
# zlib
########################################
zlib_vars = cmake.subproject_options()
zlib_vars.add_cmake_defines({
'BUILD_SHARED_LIBS' : false
})
zlib_vars.set_install(false)
zlib_proj = cmake.subproject('zlib', options : zlib_vars)
zlib_dep = zlib_proj.dependency('zlibstatic')
########################################
# libevent
########################################
libevent_vars = cmake.subproject_options()
libevent_vars.add_cmake_defines({
'EVENT__DISABLE_OPENSSL' : true,
@ -33,7 +51,32 @@ libevent_proj = cmake.subproject('libevent', options : libevent_vars)
libevent_core_dep = libevent_proj.dependency('event_core_static')
libevent_extra_dep = libevent_proj.dependency('event_extra_static')
feather_deps = [ threads_dep, libevent_core_dep, libevent_extra_dep ]
########################################
# cNBT
########################################
# TODO: cNBT
#cnbt_vars = cmake.subproject_options()
#cnbt_vars.add_cmake_defines({
# 'CNBT_BUILD_EXAMPLES' : false,
# 'BUILD_SHARED_LIBS' : false,
#})
#cnbt_vars.set_install(false)
#cnbt_proj = cmake.subproject('cNBT', options : cnbt_vars)
#cnbt_dep = cnbt_proj.dependency('nbt')
########################################
feather_deps = [
threads_dep,
zlib_dep,
libevent_core_dep,
libevent_extra_dep,
# cnbt_dep
]
if feather_platform == 'windows'
ws2_32_dep = feather_compiler.find_library('ws2_32')

View File

@ -22,7 +22,11 @@ subdir('protocol')
executable('FeatherMC', feather_src, protocol_headers,
dependencies : feather_deps,
include_directories : include_directories('.', '../subprojects/rapidjson/include'),
include_directories : include_directories(
'.',
'../subprojects/rapidjson/include',
'../subprojects' # for zlib and cNBT, which have no include dir
),
install : true,
install_dir : meson.source_root() + '/bin',
override_options : [ 'cpp_std=' + feather_cpp_std ])

1
subprojects/zlib Submodule

@ -0,0 +1 @@
Subproject commit cacf7f1d4e3d44d871b605da3b647f07d718623f