Updated meson build

This commit is contained in:
gabime
2019-09-18 15:01:23 +03:00
parent e771f4e75e
commit 7733849478
5 changed files with 58 additions and 30 deletions

View File

@@ -1,20 +1,27 @@
test_sources = files([
'main.cpp',
'test_async.cpp',
'test_dup_filter.cpp',
'test_errors.cpp',
'test_file_helper.cpp',
'test_file_logging.cpp',
'test_fmt_helper.cpp',
'test_macros.cpp',
'test_misc.cpp',
'test_mpmc_q.cpp',
'test_pattern_formatter.cpp',
'test_registry.cpp',
'test_stdout_api.cpp',
'utils.cpp',
'test_file_helper.cpp',
'test_file_logging.cpp',
'test_daily_logger.cpp',
'test_misc.cpp',
'test_pattern_formatter.cpp',
'test_async.cpp',
'includes.h',
'test_registry.cpp',
'test_macros.cpp',
'utils.cpp',
'main.cpp',
'test_mpmc_q.cpp',
'test_fmt_helper.cpp',
'test_stdout_api.cpp',
'test_dup_filter.cpp',
'test_backtrace.cpp'
])
if not get_option('no_exceptions')
test_sources += 'test_errors.cpp'
endif
global_test_deps = []
# -----------------------------------------------------
@@ -24,20 +31,23 @@ global_test_deps = []
systemd_dep = dependency('libsystemd', required: false)
if systemd_dep.found()
test_sources += files(['test_systemd.cpp'])
test_sources += 'test_systemd.cpp'
global_test_deps += systemd_dep
endif
run_command('mkdir', 'logs')
# --------------------------------------
# --- Build the test executables ---
# --------------------------------------
test_matrix = [
['spdlog-utest', spdlog_dep],
['spdlog-utest-ho', spdlog_headeronly_dep],
['spdlog-utests', spdlog_dep],
['spdlog-utests-ho', spdlog_headeronly_dep],
]
foreach i : test_matrix
test_exe = executable(i[0], test_sources, dependencies: global_test_deps + [i[1]])
test('test_' + i[0], test_exe)
endforeach
run_command(find_program('mkdir'), meson.current_build_dir() + '/logs')