meson: Update minimum version to 0.57.0
Required for c++20 suppport.
Change-Id: If50d094a1ed68a5fbe5a5383e0840efea3eb64eb
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/meson.build b/meson.build
index eacb214..cab35d6 100644
--- a/meson.build
+++ b/meson.build
@@ -2,7 +2,7 @@
'stdplus',
'cpp',
version: '0.1',
- meson_version: '>=0.53.2',
+ meson_version: '>=0.57.0',
default_options: [
'warning_level=3',
'cpp_std=c++17',
diff --git a/src/meson.build b/src/meson.build
index b66fec2..a169421 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -2,12 +2,14 @@
fmt_dep = dependency('fmt', required: false)
if not fmt_dep.found()
+ fmt_opts = import('cmake').subproject_options()
+ fmt_opts.add_cmake_defines({
+ 'CMAKE_POSITION_INDEPENDENT_CODE': 'ON',
+ 'MASTER_PROJECT': 'OFF',
+ })
fmt_proj = import('cmake').subproject(
'fmt',
- cmake_options: [
- '-DCMAKE_POSITION_INDEPENDENT_CODE=ON',
- '-DMASTER_PROJECT=OFF'
- ],
+ options: fmt_opts,
required: false)
assert(fmt_proj.found(), 'fmtlib is required')
fmt_dep = fmt_proj.dependency('fmt')
diff --git a/test/meson.build b/test/meson.build
index 4e7f2b6..6be8abc 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -1,11 +1,11 @@
gtest = dependency('gtest', main: true, disabler: true, required: false)
gmock = dependency('gmock', disabler: true, required: false)
if not gtest.found() or not gmock.found()
+ gtest_opts = import('cmake').subproject_options()
+ gtest_opts.add_cmake_defines({'CMAKE_CXX_FLAGS': '-Wno-pedantic'})
gtest_proj = import('cmake').subproject(
'googletest',
- cmake_options: [
- '-DCMAKE_CXX_FLAGS=-Wno-pedantic',
- ],
+ options: gtest_opts,
required: false)
if gtest_proj.found()
gtest = declare_dependency(
@@ -74,12 +74,14 @@
endif
endif
if not catch2.found()
+ catch2_opts = import('cmake').subproject_options()
+ catch2_opts.add_cmake_defines({
+ 'BUILD_TESTING': 'OFF',
+ 'CMAKE_CXX_FLAGS': '-Wno-non-virtual-dtor',
+ })
catch2_proj = import('cmake').subproject(
'Catch2',
- cmake_options: [
- '-DBUILD_TESTING=OFF',
- '-DCMAKE_CXX_FLAGS=-Wno-non-virtual-dtor',
- ],
+ options: catch2_opts,
required: false)
if catch2_proj.found()
catch2 = declare_dependency(