remove-dependencies (#20)
All checks were successful
Build ptprnt / build (push) Successful in 2m10s
All checks were successful
Build ptprnt / build (push) Successful in 2m10s
Reviewed-on: #20
This commit was merged in pull request #20.
This commit is contained in:
35
meson.build
35
meson.build
@@ -20,10 +20,16 @@ project(
|
||||
)
|
||||
|
||||
usb_dep = dependency('libusb-1.0')
|
||||
log_dep = dependency('spdlog')
|
||||
fmt_dep = dependency('fmt')
|
||||
pangocairo_dep = dependency('pangocairo')
|
||||
|
||||
# spdlog with std::format (C++20) - static library
|
||||
spdlog_proj = subproject('spdlog', default_options: ['std_format=enabled', 'default_library=static', 'compile_library=true'])
|
||||
log_dep = spdlog_proj.get_variable('spdlog_dep')
|
||||
|
||||
if not log_dep.found()
|
||||
error('spdlog not found, can not proceed')
|
||||
endif
|
||||
|
||||
# CLI11
|
||||
cli11_proj = subproject('cli11')
|
||||
cli11_dep = cli11_proj.get_variable('CLI11_dep')
|
||||
@@ -50,20 +56,27 @@ ptprnt_exe = executable(
|
||||
'ptprnt',
|
||||
'src/main.cpp',
|
||||
install: true,
|
||||
dependencies: [usb_dep, log_dep, fmt_dep, pangocairo_dep, cli11_dep],
|
||||
dependencies: [usb_dep, log_dep, pangocairo_dep, cli11_dep],
|
||||
include_directories: incdir,
|
||||
sources: [ptprnt_srcs],
|
||||
cpp_args: cpp_args,
|
||||
)
|
||||
|
||||
### Unit tests
|
||||
# Only build tests for debug builds or when explicitly enabled
|
||||
build_tests = get_option('buildtype') == 'debug' or get_option('build_tests')
|
||||
|
||||
# GTest and GMock
|
||||
gtest_proj = subproject('gtest')
|
||||
gtest_dep = gtest_proj.get_variable('gtest_main_dep')
|
||||
gmock_dep = gtest_proj.get_variable('gmock_main_dep')
|
||||
if not gtest_dep.found()
|
||||
error('MESON_SKIP_TEST: gtest not installed.')
|
||||
endif
|
||||
if build_tests
|
||||
# GTest and GMock
|
||||
gtest_proj = subproject('gtest')
|
||||
gtest_dep = gtest_proj.get_variable('gtest_main_dep')
|
||||
gmock_dep = gtest_proj.get_variable('gmock_main_dep')
|
||||
if not gtest_dep.found()
|
||||
error('MESON_SKIP_TEST: gtest not installed.')
|
||||
endif
|
||||
|
||||
subdir('tests')
|
||||
subdir('tests')
|
||||
message('Tests enabled (buildtype=' + get_option('buildtype') + ')')
|
||||
else
|
||||
message('Tests disabled (use debug build or -Dbuild_tests=true to enable)')
|
||||
endif
|
||||
Reference in New Issue
Block a user