From patchwork Fri Sep 13 18:01:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 1964 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 10F9C60BB2 for ; Fri, 13 Sep 2019 20:01:43 +0200 (CEST) Received: from pendragon.lan (unknown [IPv6:2001:8a0:6be4:9301:a728:6099:33:a27c]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 524A5325; Fri, 13 Sep 2019 20:01:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1568397702; bh=jL5LyMjccshYxR31rgW55lpDFlPhRlXrIlaClW2ZH+g=; h=From:To:Cc:Subject:Date:From; b=t6oTAiZ2gAe7oUN97KWI009FOW/XIF02Ez1UWIQ2w74uiJOF/1AiedS4MdWUahYv1 pdbUGBHi/OUcvnHy1LdySrbp/+wpEseEIq9eDaMV4SJbc66GWgQX8r6SWZRvUcXDqv +ghHP4bHrcQlvNuTM1W1wxCtg/sD7kuDnTqLzlMU= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Fri, 13 Sep 2019 21:01:32 +0300 Message-Id: <20190913180132.31000-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] qcam: Fix compilation errors with gcc-9 and Qt < 5.13 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 18:01:43 -0000 gcc-9 has introduced a deprecated-copy warning that is triggered by Qt header files. The issue has been fixed in Qt 5.13. Fix compilation with earlier Qt versions by disabling the warning. In order to still benefit from the warning when possible, only disable it for gcc-9 and Qt < 5.13. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- src/qcam/meson.build | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/qcam/meson.build b/src/qcam/meson.build index 21f91f25cec0..1e71f20fa15e 100644 --- a/src/qcam/meson.build +++ b/src/qcam/meson.build @@ -18,11 +18,23 @@ qt5_dep = dependency('qt5', required : false) if qt5_dep.found() + qt5_cpp_args = [ '-DQT_NO_KEYWORDS' ] + + # gcc 9 introduced a deprecated-copy warning that is triggered by Qt until + # Qt 5.13. Disable it manually. + if cc.get_id() == 'gcc' + gcc_version = cc.version().split('.') + qt5_version = qt5_dep.version().split('.') + if qt5_version[1].to_int() < 13 and gcc_version[0].to_int() >= 9 + qt5_cpp_args += [ '-Wno-deprecated-copy' ] + endif + endif + moc_files = qt5.preprocess(moc_headers: qcam_moc_headers, dependencies: qt5_dep) qcam = executable('qcam', qcam_sources, moc_files, install : true, dependencies : [libcamera_dep, qt5_dep], - cpp_args : '-DQT_NO_KEYWORDS') + cpp_args : qt5_cpp_args) endif