FeatherMC/meson.build

72 lines
2.0 KiB
Meson
Raw Normal View History

2020-07-25 03:01:16 +01:00
project('FeatherMC', ['c', 'cpp'], version : '0.0', meson_version : '>= 0.55', default_options : [
2020-07-24 10:20:35 +01:00
'warning_level=2',
2020-08-10 00:15:07 +01:00
'backend_startup_project=FeatherMC'
2020-07-24 10:20:35 +01:00
])
add_project_arguments('-DNOMINMAX', language : 'cpp')
feather_compiler = meson.get_compiler('cpp')
feather_platform = target_machine.system()
2020-08-07 01:26:46 +01:00
feather_msvc = feather_compiler.get_id() == 'msvc'
feather_cpp_std = feather_msvc ? 'c++latest' : 'c++17'
2020-07-24 10:20:35 +01:00
if feather_compiler.get_id() == 'msvc'
add_project_arguments('/std:' + feather_cpp_std, language : 'cpp')
endif
threads_dep = dependency('threads')
2020-07-25 03:01:16 +01:00
cmake = import('cmake')
2020-08-02 04:47:53 +01:00
########################################
# libevent
########################################
2020-07-25 03:01:16 +01:00
libevent_vars = cmake.subproject_options()
libevent_vars.add_cmake_defines({
'EVENT__DISABLE_OPENSSL' : true,
'EVENT__DISABLE_MBEDTLS' : true,
'EVENT__DISABLE_BENCHMARK' : true,
'EVENT__DISABLE_TESTS' : true,
'EVENT__DISABLE_REGRESS' : true,
'EVENT__DISABLE_SAMPLES' : true,
'EVENT__LIBRARY_TYPE' : 'STATIC',
})
2020-07-25 07:06:25 +01:00
libevent_vars.set_install(false)
2020-07-25 03:01:16 +01:00
libevent_proj = cmake.subproject('libevent', options : libevent_vars)
2020-08-01 00:55:47 +01:00
libevent_core_dep = libevent_proj.dependency('event_core_static')
libevent_extra_dep = libevent_proj.dependency('event_extra_static')
2020-08-02 04:47:53 +01:00
########################################
# cNBT
########################################
2020-08-07 01:23:52 +01:00
cnbt_proj = subproject('cNBT')
cnbt_dep = cnbt_proj.get_variable('cnbt_dep')
2020-08-02 04:47:53 +01:00
########################################
feather_deps = [
threads_dep,
libevent_core_dep,
libevent_extra_dep,
2020-08-02 04:57:32 +01:00
cnbt_dep
2020-08-02 04:47:53 +01:00
]
2020-07-25 03:01:16 +01:00
2020-07-24 10:20:35 +01:00
if feather_platform == 'windows'
2020-07-25 03:01:16 +01:00
ws2_32_dep = feather_compiler.find_library('ws2_32')
iphlpapi_dep = feather_compiler.find_library('iphlpapi')
2020-08-07 01:31:56 +01:00
bcrypt_dep = feather_compiler.find_library('bcrypt')
2020-07-25 03:01:16 +01:00
2020-08-07 01:31:56 +01:00
feather_deps += [ ws2_32_dep, iphlpapi_dep, bcrypt_dep ]
2020-08-01 00:55:47 +01:00
else
libevent_pthreads_dep = libevent_proj.dependency('event_pthreads_static')
feather_deps += [ libevent_pthreads_dep ]
2020-07-24 10:20:35 +01:00
endif
2020-08-02 02:44:35 +01:00
python = find_program('python')
2020-07-24 10:20:35 +01:00
subdir('src')