meson: Define cpp_std in the top-level project()
authorNirbheek Chauhan <nirbheek@centricular.com>
Wed, 13 Oct 2021 08:05:51 +0000 (13:35 +0530)
committerSeungha Yang <seungha@centricular.com>
Sun, 17 Oct 2021 09:36:09 +0000 (09:36 +0000)
Due to a bug, meson ignores ${lang}_std settings in default_options
for subprojects: https://github.com/mesonbuild/meson/issues/1889

This causes build failures when a subproject requires c++11 or c++14,
etc. Compilers that support those cpp_stds are very common, and all
the toolchains that we support include c++ compilers, so we can
add cpp_std=c++14 to the top-level.

This fixes the webrtc-audio-processing build on Linux, and harfbuzz on
macOS.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1133>

meson.build

index c10098a..4a0108c 100644 (file)
@@ -1,7 +1,11 @@
 project('All GStreamer modules', 'c',
   version : '1.19.2.1',
   meson_version : '>= 0.54.0',
-  default_options : ['buildtype=debugoptimized'])
+  default_options : ['buildtype=debugoptimized',
+                     # Needed due to https://github.com/mesonbuild/meson/issues/1889,
+                     # but this can cause problems in the future. Remove it
+                     # when it's no longer necessary.
+                     'cpp_std=c++14'])
 
 gst_version = '>= @0@'.format(meson.project_version())