diff options
| author | 2026-08-25 19:39:56 -0400 | |
|---|---|---|
| committer | 2026-08-25 19:39:56 -0400 | |
| commit | 8ebcc1fa354fac87771caa88ee67600412bbcb57 (patch) | |
| tree | 3413702b92b225bf59e733d250b599bef6781078 /meson.build | |
| parent | 87a93623126c41cdfdbdb62878efb3f1d33b819e (diff) | |
| download | libnaunet-8ebcc1fa354fac87771caa88ee67600412bbcb57.tar.gz libnaunet-8ebcc1fa354fac87771caa88ee67600412bbcb57.tar.bz2 libnaunet-8ebcc1fa354fac87771caa88ee67600412bbcb57.zip | |
Global temp path, android build fixes
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'meson.build')
| -rw-r--r-- | meson.build | 60 |
1 files changed, 39 insertions, 21 deletions
diff --git a/meson.build b/meson.build index 751f6f6..9ebce68 100644 --- a/meson.build +++ b/meson.build @@ -4,11 +4,15 @@ project('libnaunet', 'c', version: '0.01', license: 'GPL-3.0-only') compiler = meson.get_compiler('c') -cmake = import('cmake') is_debug = get_option('debug') is_minsize = get_option('optimization') == 's' is_windows = host_machine.system() == 'windows' +is_android = host_machine.system() == 'android' +is_static_shared_lib = is_android + +cmake = import('cmake') +cmake_reltype = is_minsize ? 'MinSizeRel' : 'Release' naunet_src = [ 'src/common.c', @@ -57,33 +61,44 @@ if get_option('event-loop').enabled() libcurl_found = libcurl.found() endif if not libcurl_found + bare_minimum_curl = is_android curl_opts = cmake.subproject_options() - reltype = is_minsize ? 'MinSizeRel' : 'Release' - curl_opts.add_cmake_defines({ 'CMAKE_BUILD_TYPE': is_debug ? 'Debug' : reltype }) + curl_opts.add_cmake_defines({ 'CMAKE_BUILD_TYPE': is_debug ? 'Debug' : cmake_reltype }) + curl_opts.add_cmake_defines({ 'CMAKE_POSITION_INDEPENDENT_CODE': is_static_shared_lib }) + curl_opts.add_cmake_defines({ 'BUILD_LIBCURL_DOCS': false }) + curl_opts.add_cmake_defines({ 'BUILD_MISC_DOCS': false }) + curl_opts.add_cmake_defines({ 'ENABLE_CURL_MANUAL': false }) + curl_opts.add_cmake_defines({ 'BUILD_TESTING': false }) curl_opts.add_cmake_defines({ 'BUILD_CURL_EXE': false }) curl_opts.add_cmake_defines({ 'BUILD_SHARED_LIBS': false }) curl_opts.add_cmake_defines({ 'BUILD_STATIC_LIBS': true }) + curl_opts.add_cmake_defines({ 'ENABLE_WEBSOCKETS': true }) + if not bare_minimum_curl + curl_opts.add_cmake_defines({ 'CURL_USE_OPENSSL': true }) + openssl = dependency('openssl') + naunet_deps += [openssl] + else + curl_opts.add_cmake_defines({ 'CURL_USE_OPENSSL': false }) + endif + if not bare_minimum_curl + if is_windows + curl_opts.add_cmake_defines({ 'USE_WIN32_IDN': true }) + naunet_deps += [ + compiler.find_library('bcrypt'), + compiler.find_library('crypt32') + ] + else + curl_opts.add_cmake_defines({ 'USE_LIBIDN2': true }) + libidn2 = dependency('libidn2') + naunet_deps += [libidn2] + endif + endif curl_opts.add_cmake_defines({ 'CURL_USE_LIBSSH2': false }) curl_opts.add_cmake_defines({ 'CURL_USE_LIBPSL': false }) curl_opts.add_cmake_defines({ 'CURL_DISABLE_LDAP': true }) - curl_opts.add_cmake_defines({ 'CURL_USE_OPENSSL': true }) - curl_opts.add_cmake_defines({ 'ENABLE_WEBSOCKETS': true }) libcurl = cmake.subproject('libcurl', options: curl_opts).dependency('libcurl_static') zlib = dependency('zlib') - openssl = dependency('openssl') - naunet_deps += [zlib, openssl] - if is_windows - curl_opts.add_cmake_defines({ 'USE_LIBIDN2': false }) - curl_opts.add_cmake_defines({ 'USE_WIN32_IDN': true }) - naunet_deps += [ - compiler.find_library('bcrypt'), - compiler.find_library('crypt32') - ] - else - curl_opts.add_cmake_defines({ 'USE_LIBIDN2': true }) - libidn2 = dependency('libidn2') - naunet_deps += [libidn2] - endif + naunet_deps += [zlib] endif naunet_has_curl = libcurl.found() if naunet_has_curl @@ -109,8 +124,8 @@ if get_option('json').enabled() endif if not jansson_found jansson_opts = cmake.subproject_options() - reltype = is_minsize ? 'MinSizeRel' : 'Release' - jansson_opts.add_cmake_defines({ 'CMAKE_BUILD_TYPE': is_debug ? 'Debug' : reltype }) + jansson_opts.add_cmake_defines({ 'CMAKE_BUILD_TYPE': is_debug ? 'Debug' : cmake_reltype }) + jansson_opts.add_cmake_defines({ 'CMAKE_POSITION_INDEPENDENT_CODE': is_static_shared_lib }) jansson_opts.add_cmake_defines({ 'JANSSON_EXAMPLES': false }) jansson_opts.add_cmake_defines({ 'JANSSON_WITHOUT_TESTS': true }) jansson_opts.add_cmake_defines({ 'JANSSON_BUILD_DOCS': false }) @@ -141,6 +156,9 @@ if is_windows compiler.find_library('ws2_32') ] else + if is_android + naunet_args += ['-DNAUNET_ON_ANDROID'] + endif naunet_src += [ 'src/util/timer/timer_linux.c', 'src/util/thread/thread_linux.c', |