Skip to content

Commit

Permalink
Add meson.build
Browse files Browse the repository at this point in the history
  • Loading branch information
woelfman committed May 28, 2020
1 parent b4900db commit b35bd80
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This repository contains a Meson build definition for project Mosquitto.

For more information please see http://mesonbuild.com.
59 changes: 59 additions & 0 deletions lib/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
subdir('cpp')

sources = [
'actions.c',
'callbacks.c',
'connect.c',
'handle_auth.c',
'handle_connack.c',
'handle_disconnect.c',
'handle_ping.c',
'handle_pubackcomp.c',
'handle_publish.c',
'handle_pubrec.c',
'handle_pubrel.c',
'handle_suback.c',
'handle_unsuback.c',
'helpers.c',
'logging_mosq.c',
'loop.c',
'memory_mosq.c',
'messages_mosq.c',
'misc_mosq.c',
'mosquitto.c',
'net_mosq_ocsp.c',
'net_mosq.c',
'options.c',
'packet_datatypes.c',
'packet_mosq.c',
'property_mosq.c',
'read_handle.c',
'send_connect.c',
'send_disconnect.c',
'send_mosq.c',
'send_publish.c',
'send_subscribe.c',
'send_unsubscribe.c',
'send_mosq.c',
'socks_mosq.c',
'srv_mosq.c',
'thread_mosq.c',
'time_mosq.c',
'tls_mosq.c',
'utf8_mosq.c',
'util_mosq.c',
'util_topic.c',
'will_mosq.c',
]

libmosquitto = library('mosquitto', sources : [sources],
version : meson.project_version(),
soversion : 1,
include_directories : ['..'],
dependencies : [openssl_dep, threading_dep],
install : true,
)

mosquitto_dep = declare_dependency(link_with : [libmosquitto],
include_directories : ['.'],
)
39 changes: 39 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
project('mosquitto', 'c', version : '1.6.9')

with_tls = get_option('with-tls')

if with_tls
add_project_arguments('-DWITH_TLS', language : 'c')
endif

if get_option('with-tls-psk')
with_tls = true
with_tls_psk = true
add_project_arguments('-DWITH_TLS_PSK', language : 'c')
endif

if get_option('with-ec')
with_tls = true
add_project_arguments('-DWITH_EC', language : 'c')
endif

openssl_dep = dependency('openssl', required : with_tls)

with_socks = get_option('with-socks')
if with_socks
add_project_arguments('-DWITH_SOCKS', language : 'c')
endif

with_threading = get_option('with-threading')
if with_threading
add_project_arguments('-DWITH_THREADING', language : 'c')
endif
threading_dep = dependency('threads', required : with_threading)

with_dlt = get_option('with-dlt')
if with_dlt
dlt_dep = dependency('automotive-dlt', version : '>=2.11', required : true)
add_project_arguments('-DWITH_DLT', language : 'c')
endif

subdir('lib')
7 changes: 7 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
option('with-tls', type : 'boolean', value : true, description : 'Include SSL/TLS support')
option('with-tls-psk', type : 'boolean', value : true, description : 'Include TLS-PSK support')
option('with-ec', type : 'boolean', value : true, description : 'Include Elliptic Curve support')
option('with-socks', type : 'boolean', value : true, description : 'Include SOCKS5 support')
option('with-srv', type : 'boolean', value : false, description : 'Include SRV lookup support')
option('with-threading', type : 'boolean', value : true, description : 'Include client library threading support')
option('with-dlt', type : 'boolean', value : false, description : 'Include DLT support')
10 changes: 10 additions & 0 deletions upstream.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[wrap-file]
directory = mosquitto-1.6.9

source_url = https://github.com/eclipse/mosquitto/archive/v1.6.9.tar.gz
source_filename = mosquitto-1.6.9.tar.gz
source_hash = 6685d6e1d56e0618595c8fcc4f7c595a175dac7a145418150a854781b0e046af

patch_url = https://github.com/woelfman/mosquitto/releases/download/1.6.9-1/mosquitto-1.6.9-1-wrap.zip
patch_filename = mosquitto-1.6.9-1-wrap.zip
patch_hash = 7195a2d1067e5c63d868beceaf56e74a4aa76e5c6f784458a29ad051b67b0a01

0 comments on commit b35bd80

Please sign in to comment.