Add meson build scripts

This commit is contained in:
King_DuckZ 2022-06-07 16:41:49 +02:00
parent 9919f1aeb2
commit 82b5200857
11 changed files with 2789 additions and 2 deletions

2
.gitmodules vendored
View file

@ -1,3 +1,3 @@
[submodule "lib/Catch2"]
path = lib/Catch2
path = subprojects/Catch2/Catch2
url = https://github.com/catchorg/Catch2.git

32
include/meson.build Normal file
View file

@ -0,0 +1,32 @@
if not meson.is_subproject() and meson.version().version_compare('>=0.63.0')
install_headers(
'duckhandy/implem/IteratorOnPtr.hpp',
'duckhandy/implem/AutomemBase.hpp',
'duckhandy/implem/AutomemBase.inl',
'duckhandy/implem/int_conv.hpp',
'duckhandy/implem/reversed_sized_array_bt.hpp',
'duckhandy/version_bt.hpp',
'duckhandy/has_method.hpp',
'duckhandy/MaxSizedArray.hpp',
'duckhandy/MaxSizedArray.inl',
'duckhandy/bitfield_pack.hpp',
'duckhandy/cmake_on_off.h',
'duckhandy/compatibility.h',
'duckhandy/ducktypes.hpp',
'duckhandy/endianness.hpp',
'duckhandy/tiger_bt.hpp',
'duckhandy/infix_iterator.hpp',
'duckhandy/int_conv.hpp',
'duckhandy/int_types.hpp',
'duckhandy/lengthof.h',
'duckhandy/nomove_storage.hpp',
'duckhandy/resource_pool.hpp',
'duckhandy/tiger_bt.inl',
'duckhandy/string.hpp',
'duckhandy/string_bt.hpp',
'duckhandy/string_view.hpp',
'duckhandy/stringize.h',
'duckhandy/variadic_repeat_bt.hpp',
preserve_path: true, #meson v0.63.0
)
endif

22
meson.build Normal file
View file

@ -0,0 +1,22 @@
project('duckhandy',
version: '0.1.0',
meson_version: '>=0.56.0',
default_options: ['buildtype=release', 'cpp_std=gnu++20', 'b_ndebug=if-release']
)
sprout_dep = dependency('sprout', allow_fallback: true)
public_incl = include_directories('include')
duckhandy_dep = declare_dependency(
include_directories: [
public_incl,
],
dependencies: [sprout_dep],
)
if get_option('build_testing')
subdir('test')
endif
subdir('include')

1
meson_options.txt Normal file
View file

@ -0,0 +1 @@
option('build_testing', type: 'boolean', value: true)

View file

@ -0,0 +1,11 @@
project('Catch2',
version: '2.13.6',
meson_version: '>=0.54.0',
)
public_incl = include_directories('Catch2/single_include')
catch2_dep = declare_dependency(
include_directories: public_incl
)
meson.override_dependency(meson.project_name(), catch2_dep)

File diff suppressed because it is too large Load diff

7
subprojects/sprout.wrap Normal file
View file

@ -0,0 +1,7 @@
[wrap-git]
url = https://github.com/bolero-MURAKAMI/Sprout.git
revision = head
patch_directory = sprout
[provide]
dependency_names = sprout-20190615

1
test/meson.build Normal file
View file

@ -0,0 +1 @@
subdir('unit')

View file

@ -14,7 +14,7 @@ set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17)
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
target_include_directories(${PROJECT_NAME}
PRIVATE ${DUCKHANDY_SOURCE_DIR}/lib/Catch2/single_include
PRIVATE ${DUCKHANDY_SOURCE_DIR}/subprojects/Catch2/Catch2/single_include
)
target_link_libraries(${PROJECT_NAME}

19
test/unit/meson.build Normal file
View file

@ -0,0 +1,19 @@
catch2_dep = dependency('Catch2', fallback: ['Catch2', 'catch2_dep'])
unit_test_prog = executable(meson.project_name(),
'int_conv_test.cpp',
'main.cpp',
'endianness_test.cpp',
'reversed_sized_array_test.cpp',
'bitfield_pack_test.cpp',
'resource_pool_test.cpp',
'version_test.cpp',
'tiger_test.cpp',
install: false,
dependencies: [sprout_dep, catch2_dep],
include_directories: [public_incl],
)
test('unit_' + meson.project_name(),
unit_test_prog,
)