berthubert / simplomon

Very simple monitoring system with a single configuration file
MIT License
97 stars 12 forks source link

Doesn't compile on FreeBSD without help (Doctest) #5

Closed nreilly closed 3 months ago

nreilly commented 3 months ago

Hello,

I'm trying to get this to compile on FreeBSD (having never used meson/C++/etc before) and have managed to get it to work if I add:

incdir = include_directories('/usr/local/include/doctest')

and modify the testrunner executable() to include the include_directories

executable('testrunner', 'testrunner.cc', 'notifiers.cc', 'minicurl.cc', 'dnsmon.cc', 'record-types.cc', 
              'dnsmessages.cc', 'dns-storage.cc', 'netmon.cc', 'luabridge.cc',
       dependencies: [doctest_dep, curl_dep, json_dep, fmt_dep, cpphttplib, simplesockets_dep,
              lua_dep],
       include_directories: incdir)

Is this something that can be added in a portable way? Maybe something like:

if host_machine.system() in ['freebsd']
  incdir = include_directories('/usr/local/include/doctest')
  executable('testrunner', 'testrunner.cc', 'notifiers.cc', 'minicurl.cc', 'dnsmon.cc', 'record-types.cc', 'dnsmessages.cc', 'dns-storage.cc', 'netmon.cc', 'luabridge.cc',
        dependencies: [doctest_dep, curl_dep, json_dep, fmt_dep, cpphttplib, simplesockets_dep, lua_dep],
        include_directories: incdir)
else
  executable('testrunner', 'testrunner.cc', 'notifiers.cc', 'minicurl.cc', 'dnsmon.cc', 'record-types.cc', 'dnsmessages.cc', 'dns-storage.cc', 'netmon.cc', 'luabridge.cc',
        dependencies: [doctest_dep, curl_dep, json_dep, fmt_dep, cpphttplib, simplesockets_dep, lua_dep])
endif
nreilly commented 3 months ago

As testrunner has now been commented out of the standard meson.build file, this is no longer a problem.