From 2e5db45aba607dcc7c79ff892bbb82af46ddb918 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Fri, 17 Feb 2017 15:02:46 +0100 Subject: Added deprecated API warnings --- src/smolbote.qbs | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/src/smolbote.qbs b/src/smolbote.qbs index ab63f9b..439014c 100644 --- a/src/smolbote.qbs +++ b/src/smolbote.qbs @@ -3,18 +3,31 @@ import "GitRepo.js" as GitRepo Project { id: project - minimumQbsVersion: "1.7.0" - property bool gitFlag: true + // Qt 5.7 has qbs version 1.6.0 + // Qt 5.8 has qbs version 1.7.0 + minimumQbsVersion: "1.6.0" + + property bool gitVersion: true + + // The following define makes your compiler emit warnings if you use any + // feature of Qt which as been marked as deprecated (the exact warnings + // depend on your compiler). Please consult the documentation of the + // deprecated API in order to know how to port your code away from it. + + // The code also fails to compile if you use APIs deprecated before Qt 5,7. + property bool deprecatedWarnings: true CppApplication { + id: poi name: "poi" + property stringList defines: [] Probe { id: git property string version: "1.0.0" property string describe: "1.0.0-0-00000000" configure: { - if(project.gitFlag) { + if(project.gitVersion) { var meta = GitRepo.read(project.sourceDirectory); version = meta.version; describe = meta.describe; @@ -24,9 +37,12 @@ Project { } cpp.includePaths: ['.'] - Properties { - condition: git.found - cpp.defines: ['VERSION="'+git.version+'"'] + cpp.defines: { + if(project.deprecatedWarnings) + defines.push("QT_DEPRECATED_WARNINGS", "QT_DISABLE_DEPRECATED_BEFORE=0x050700"); + if(git.found) + defines.push('VERSION="'+git.version+'"'); + return defines; } files: [ -- cgit v1.2.1