# We collect all sources for the 'big' libgnunet when traversing
# the subdirectories.
if get_option('monolith')
  gnunet_src = []
endif

subdir('util')
subdir('statistics')
subdir('arm')
subdir('peerstore')
subdir('nat')
subdir('transport')

if not get_option('monolith')
  subdir_done()
endif

# Compile the 'big' libgnunet shared library.
# It must be compiled with HAVE_GNUNET_MONOLITH to enable
# the correct service macros that do not inject main() functions
# to services.
libgnunet = library('gnunet',
                    gnunet_src,
                    dependencies: [
                      sodium_dep,
                      gcrypt_dep,
                      zlib_dep,
                      sqlite_dep,
                      unistr_dep,
                      ltdl_dep,
                      idn_dep,
                      libgnunetutil_dep,
                      libgnunethello_dep,
                      jose_dep,
                      m_dep,
                      pthread_dep],
                    c_args: ['-DHAVE_GNUNET_MONOLITH=1'],
                    include_directories: [incdir, configuration_inc])
libgnunet_dep = declare_dependency(link_with : libgnunet)
