From 7cf6ae4b5f7f88435646d4acc89c4c4d46c369b7 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Wed, 4 Mar 2020 14:42:35 +0000
Subject: [PATCH] Select the same C and C++ language as steam-runtime-tools

We need this if we're using the steam-runtime-tools subproject with a
compiler from the distant past, like the one in Steam Runtime 1 'scout'.

Signed-off-by: Simon McVittie <smcv@collabora.com>
---
 debian/control       | 1 +
 debian/gitlab-ci.yml | 3 +++
 debian/rules         | 4 ++++
 meson.build          | 2 ++
 4 files changed, 10 insertions(+)

diff --git a/debian/control b/debian/control
index 4db9d42c5..eb432da46 100644
--- a/debian/control
+++ b/debian/control
@@ -5,6 +5,7 @@ Maintainer: Simon McVittie <smcv@collabora.com>
 Standards-Version: 4.4.0
 Build-Depends:
  debhelper (>= 9),
+ g++ (>= 4:4.8) | g++-4.8,
  libglib2.0-dev,
  libsteam-runtime-tools-0-dev (>= 0.20190926.0~),
  libxau-dev,
diff --git a/debian/gitlab-ci.yml b/debian/gitlab-ci.yml
index ac6ce36c7..889471f25 100644
--- a/debian/gitlab-ci.yml
+++ b/debian/gitlab-ci.yml
@@ -131,6 +131,9 @@ build:scout:
               ${NULL+}
             fi
 
+            # g++ 4.6 is too old for the submodule (see also debian/rules)
+            export CXX=g++-4.8
+
             meson \
               --prefix="$(pwd)/_build/prefix" \
               -Dsrcdir=src \
diff --git a/debian/rules b/debian/rules
index e5c89d9ff..20f722eaf 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,6 +7,10 @@ export LC_ALL=C.UTF-8
 
 include /usr/share/dpkg/default.mk
 
+ifeq ($(shell dpkg --compare-versions `c++ -dumpversion || echo 0` ge 4.8 || echo old),old)
+export CXX = g++-4.8
+endif
+
 meson_options =
 
 ifeq ($(DEB_DISTRIBUTION),UNRELEASED)
diff --git a/meson.build b/meson.build
index c01943700..4ae11f032 100644
--- a/meson.build
+++ b/meson.build
@@ -24,6 +24,8 @@
 project(
   'pressure-vessel', 'c',
   default_options: [
+    'c_std=c99',
+    'cpp_std=c++11',
     'warning_level=2',
   ],
 )
-- 
GitLab