Commit 7309b6a2 authored by Joerg Bornemann's avatar Joerg Bornemann
Browse files

enable C++11 support in qbs build



Change-Id: I64e39a4a3e3ec2ac4940f997c402fdd3fef4bf5b
Reviewed-by: default avatarJoerg Bornemann <joerg.bornemann@digia.com>
parent 8163d0bb
......@@ -22,3 +22,22 @@ function versionIsAtLeast(actualVersion, expectedVersion)
}
return i === expectedVersionParts.length || expectedVersionParts[i] === 0;
}
function commonCxxFlags(qbs)
{
var flags = [];
if (qbs.toolchain.contains("clang"))
flags.push("-std=c++11");
else if (qbs.toolchain.contains("gcc"))
flags.push("-std=c++0x");
return flags;
}
function commonLinkerFlags(qbs)
{
var flags = [];
if (qbs.toolchain.contains("clang"))
flags.push("-stdlib=libc++", "-lc++abi");
return flags;
}
......@@ -12,11 +12,14 @@ DynamicLibrary {
destinationDirectory: project.ide_library_path
cpp.defines: project.generalDefines
cpp.cxxFlags: QtcFunctions.commonCxxFlags(qbs)
cpp.linkerFlags: {
var flags = QtcFunctions.commonLinkerFlags(qbs);
if (qbs.buildVariant == "release" && (qbs.toolchain.contains("gcc") || qbs.toolchain.contains("mingw")))
return ["-Wl,-s"]
flags.push("-Wl,-s");
else if (qbs.buildVariant == "debug" && qbs.toolchain.contains("msvc"))
return ["/INCREMENTAL:NO"] // Speed up startup time when debugging with cdb
flags.push("/INCREMENTAL:NO"); // Speed up startup time when debugging with cdb
return flags;
}
cpp.installNamePrefix: "@rpath/PlugIns/"
cpp.rpaths: qbs.targetOS.contains("osx")
......
......@@ -27,11 +27,14 @@ Product {
cpp.installNamePrefix: "@rpath/PlugIns/" + provider + "/"
cpp.rpaths: qbs.targetOS.contains("osx") ? ["@loader_path/../..", "@executable_path/.."]
: ["$ORIGIN", "$ORIGIN/..", "$ORIGIN/../.."]
cpp.cxxFlags: QtcFunctions.commonCxxFlags(qbs)
cpp.linkerFlags: {
var flags = QtcFunctions.commonLinkerFlags(qbs);
if (qbs.buildVariant == "release" && (qbs.toolchain.contains("gcc") || qbs.toolchain.contains("mingw")))
return ["-Wl,-s"]
flags.push("-Wl,-s");
else if (qbs.buildVariant == "debug" && qbs.toolchain.contains("msvc"))
return ["/INCREMENTAL:NO"] // Speed up startup time when debugging with cdb
flags.push("/INCREMENTAL:NO"); // Speed up startup time when debugging with cdb
return flags;
}
property string pluginIncludeBase: ".." // #include <plugin/header.h>
......
import qbs.base 1.0
import QtcFunctions
Application {
type: "application" // no Mac app bundle
Depends { name: "cpp" }
cpp.defines: project.generalDefines
cpp.cxxFlags: QtcFunctions.commonCxxFlags(qbs)
cpp.linkerFlags: {
var flags = QtcFunctions.commonLinkerFlags(qbs);
if (qbs.buildVariant == "release" && (qbs.toolchain.contains("gcc") || qbs.toolchain.contains("mingw")))
return ["-Wl,-s"]
flags.push("-Wl,-s");
return flags;
}
property string toolInstallDir: project.ide_libexec_path
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment