From f2b49e6d6ca639284bffd5bcc9f9546e9e1a300e Mon Sep 17 00:00:00 2001 From: ado Date: Wed, 1 Feb 2023 00:52:23 +0100 Subject: [PATCH 1/3] Update meson dependency usage --- README.md | 3 +-- meson.build | 9 ++++++--- test/meson.build | 3 +-- test/test_helpers.hpp | 5 ----- test/test_main.cpp | 2 +- 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 57ca902..5d47692 100644 --- a/README.md +++ b/README.md @@ -632,6 +632,5 @@ revision = origin/master ``` Then simply fetch the dependency and it is ready to be used: ```meson -ssp_sub = subproject('ssp') -ssp_dep = ssp_sub.get_variable('ssp_dep') +ssp_dep = dependency('ssp') ``` diff --git a/meson.build b/meson.build index b1624e1..d365309 100644 --- a/meson.build +++ b/meson.build @@ -2,16 +2,19 @@ project('ssp', 'cpp', default_options : ['warning_level=3', 'cpp_std=c++17', - 'buildtype=debugoptimized']) + 'buildtype=debugoptimized'], + meson_version:'>=0.54.0') -fast_float_sub = subproject('fast_float') -fast_float_dep = fast_float_sub.get_variable('fast_float_dep') +fast_float_dep = dependency('fast_float') ssp_dep = declare_dependency( include_directories: include_directories('include'), dependencies: fast_float_dep ) +meson.override_dependency('ssp', ssp_dep) + if not meson.is_subproject() subdir('test') endif + diff --git a/test/meson.build b/test/meson.build index e2d33b1..ddfc5d4 100644 --- a/test/meson.build +++ b/test/meson.build @@ -7,8 +7,7 @@ test_sources = files([ 'test_extractions_without_fast_float.cpp', ]) -doctest_proj = subproject('doctest') -doctest_dep = doctest_proj.get_variable('doctest_dep') +doctest_dep = dependency('doctest') test_exe = executable( 'test_ssp', diff --git a/test/test_helpers.hpp b/test/test_helpers.hpp index 06ea703..379f288 100644 --- a/test/test_helpers.hpp +++ b/test/test_helpers.hpp @@ -1,12 +1,7 @@ #pragma once #include #include - -#ifdef CMAKE_GITHUB_CI #include -#else -#include -#endif struct buffer { char* data_{nullptr}; diff --git a/test/test_main.cpp b/test/test_main.cpp index b8e3a4b..0a3f254 100644 --- a/test/test_main.cpp +++ b/test/test_main.cpp @@ -1,2 +1,2 @@ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN -#include +#include From 6efb39b2db8475ab19e54e348360183f6ad9195c Mon Sep 17 00:00:00 2001 From: ado Date: Wed, 1 Feb 2023 00:57:32 +0100 Subject: [PATCH 2/3] Add version number to meson.build --- meson.build | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index d365309..bc32fcb 100644 --- a/meson.build +++ b/meson.build @@ -1,8 +1,11 @@ -project('ssp', 'cpp', +project( + 'ssp', + ['cpp'], default_options : - ['warning_level=3', - 'cpp_std=c++17', - 'buildtype=debugoptimized'], + ['warning_level=3', + 'cpp_std=c++17', + 'buildtype=debugoptimized'], + version: '1.3.0', meson_version:'>=0.54.0') fast_float_dep = dependency('fast_float') From 7831bbd73585f6b24ddf1dc31e654f4a0afecdee Mon Sep 17 00:00:00 2001 From: ado Date: Wed, 1 Feb 2023 01:22:43 +0100 Subject: [PATCH 3/3] Add forcefallback wrap_mode option in meson.build --- meson.build | 3 ++- test/test_helpers.hpp | 5 +++++ test/test_main.cpp | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index bc32fcb..bf6970f 100644 --- a/meson.build +++ b/meson.build @@ -4,7 +4,8 @@ project( default_options : ['warning_level=3', 'cpp_std=c++17', - 'buildtype=debugoptimized'], + 'buildtype=debugoptimized', + 'wrap_mode=forcefallback'], version: '1.3.0', meson_version:'>=0.54.0') diff --git a/test/test_helpers.hpp b/test/test_helpers.hpp index 379f288..06ea703 100644 --- a/test/test_helpers.hpp +++ b/test/test_helpers.hpp @@ -1,7 +1,12 @@ #pragma once #include #include + +#ifdef CMAKE_GITHUB_CI #include +#else +#include +#endif struct buffer { char* data_{nullptr}; diff --git a/test/test_main.cpp b/test/test_main.cpp index 0a3f254..b8e3a4b 100644 --- a/test/test_main.cpp +++ b/test/test_main.cpp @@ -1,2 +1,2 @@ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN -#include +#include