Skip to content
This repository has been archived by the owner on Jul 19, 2022. It is now read-only.

meson: use system dependencies instead of subproject #226

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 21 additions & 15 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,28 @@ qt5_mod = import('qt5', required: false)
qt5widgets_dep = dependency('qt5', modules : 'Widgets', required: false)
qwt_dep = dependency('Qwt', method: 'cmake', cmake_module_path: join_paths(meson.source_root(), 'cmake','Modules'), required: false )

# pmtf_dep = dependency('pmtf', version : '>=0.0.2')
libpmtf = subproject('pmt')
pmtf_dep = libpmtf.get_variable('pmtf_dep')

libCLI11 = subproject('CLI11')
CLI11_dep = libCLI11.get_variable('CLI11_dep')

libjson = subproject('json')
json_dep = libjson.get_variable('nlohmann_json_dep')

libcpphttp = subproject('cpp-httplib')
cpphttp_dep = libcpphttp.get_variable('cpp_httplib_dep')
# Use internal PMT by default – we expect some movement here still
# But: offer option to look for external PMT lib; this should make package
# Maintainers a bit happier
if (get_option('external_pmt'))
# pmtf_dep = dependency('pmtf', version : '>=0.0.2')
pmtf_dep = dependency('pmtf', fallback : [ 'pmt' , 'pmtf_dep' ])
else
libpmtf = subproject('pmt')
pmtf_dep = libpmtf.get_variable('pmtf_dep')
endif
Comment on lines +48 to +57

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't really need a custom option.

Meson has these builtins:

  • --wrap-mode=forcefallback -- prefer subprojects, always
  • --force-fallback-for=pmtf -- prefer subprojects for the pmtf dependency, specifically.


# Dependencies that can be used from system or subprojects
## CLI11 : C++ command line parser
CLI11_dep = dependency('CLI11', fallback : [ 'CLI11' , 'CLI11_dep' ])
## NLohmann JSON: C++ JSON library
json_dep = dependency('nlohmann_json', fallback : [ 'json', 'nlohmann_json_dep'])
## cpp-httplib: C++11 single-file header-only cross platform HTTP/HTTPS library
cpp_httplib_dep = dependency('httplib', fallback : [ 'cpp-httplib', 'cpp_httplib_dep' ])
## cppzmq: C++ bindings for the ZeroMQ C library
cmake = import('cmake')
libcppzmq = cmake.subproject('cppzmq')
cppzmq_dep = libcppzmq.dependency('cppzmq')
cppzmq_dep = dependency('cppzmq', fallback : [ 'cppzmq' , 'cppzmq_dep' ] )


if USE_CUDA
libcusp = subproject('cusp')
Expand Down Expand Up @@ -107,4 +113,4 @@ if (get_option('enable_bench'))
endif
subdir('runtimes')
subdir('rpc')
subdir('docs')
subdir('docs')
3 changes: 3 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ option('enable_cuda', type : 'boolean', value : false)
option('enable_python', type : 'boolean', value : true)


option('external_pmt', type : 'boolean', value : false)


option('enable_gr_analog', type : 'boolean', value : true)
option('enable_gr_blocks', type : 'boolean', value : true)
option('enable_gr_digital', type : 'boolean', value : true)
Expand Down