Skip to content

Commit

Permalink
Add meson build file
Browse files Browse the repository at this point in the history
  • Loading branch information
elshize committed Jul 28, 2024
1 parent 94b9b9f commit 645fdaf
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
37 changes: 37 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
project(
'wapopp',
'cpp',
version : '1.0',
default_options : ['warning_level=3', 'cpp_std=c++17', 'default_library=static'],
subproject_dir: 'external',
)

cmake = import('cmake')
json = cmake.subproject('json').dependency('nlohmann_json')

wapopp = library(
'wapopp',
'src/wapopp.cpp',
include_directories: 'include',
dependencies: json,
install: true,
)
wapopp_dep = declare_dependency(
include_directories : 'include',
link_with : wapopp
)

build_tests = get_option('build_tests')
if build_tests
catch2 = subproject('Catch2').get_variable('catch2_with_main_dep')

tests = executable(
'test_wapopp',
# 'test/test_detail.cpp',
'test/test_wapopp.cpp',
include_directories: 'include',
dependencies: [catch2, json],
link_with: wapopp,
)
test('unit tests', tests)
endif
1 change: 1 addition & 0 deletions meson.options
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
option('build_tests', type : 'boolean', value : false, description : 'Build unit tests')

0 comments on commit 645fdaf

Please sign in to comment.