summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@digia.com>2013-11-12 18:25:08 +0100
committerChristian Kandeler <christian.kandeler@digia.com>2013-11-13 09:46:56 +0100
commit280b12ce9c474d11b0d7d8a18d690edcaad91004 (patch)
tree1e58fd2929a06681f73f18d2281b35c7578efbd1
parent93564d323514a96f6e848825e5336beff2410d2d (diff)
downloadqbs-280b12ce9c474d11b0d7d8a18d690edcaad91004.tar.gz
introduce cpp.linkerName and cpp.linkerPath
Like the compilerName/Path, the linker must be configurable. Change-Id: I50f9511dedbff29dbf55b41b96e213f238be187f Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
-rw-r--r--doc/reference/modules/cpp-module.qdoc18
-rw-r--r--share/qbs/modules/cpp/CppModule.qbs2
-rw-r--r--share/qbs/modules/cpp/GenericGCC.qbs6
-rw-r--r--share/qbs/modules/cpp/msvc.js2
-rw-r--r--share/qbs/modules/cpp/windows-msvc.qbs1
5 files changed, 26 insertions, 3 deletions
diff --git a/doc/reference/modules/cpp-module.qdoc b/doc/reference/modules/cpp-module.qdoc
index f5a05425f..532975800 100644
--- a/doc/reference/modules/cpp-module.qdoc
+++ b/doc/reference/modules/cpp-module.qdoc
@@ -334,6 +334,24 @@
Wrapper binary and its arguments for wrapping compiler calls.
This is useful for compiler wrappers like ccache and alike.
+ \section2 linkerName
+
+ \table
+ \row \li \b{Type:} \li \c{string}
+ \row \li \b{Default:} \li determined by qbs-detect-toolchains
+ \endtable
+
+ Name of the linker binary. This is set in the build profile.
+
+ \section2 linkerPath
+
+ \table
+ \row \li \b{Type:} \li \c{string}
+ \row \li \b{Default:} \li determined by qbs-detect-toolchains
+ \endtable
+
+ Full path of the linker binary. This is set in the build profile.
+
\section2 supportedStaticLibrarySuffixes
\table
diff --git a/share/qbs/modules/cpp/CppModule.qbs b/share/qbs/modules/cpp/CppModule.qbs
index e6841e499..68a805c2d 100644
--- a/share/qbs/modules/cpp/CppModule.qbs
+++ b/share/qbs/modules/cpp/CppModule.qbs
@@ -85,6 +85,8 @@ Module {
property string compilerName
property string compilerPath: compilerName
property stringList compilerWrapper
+ property string linkerName
+ property string linkerPath: linkerName
property string staticLibraryPrefix
property string dynamicLibraryPrefix
property string executablePrefix
diff --git a/share/qbs/modules/cpp/GenericGCC.qbs b/share/qbs/modules/cpp/GenericGCC.qbs
index 35821fdeb..ccb851ccc 100644
--- a/share/qbs/modules/cpp/GenericGCC.qbs
+++ b/share/qbs/modules/cpp/GenericGCC.qbs
@@ -13,6 +13,7 @@ CppModule {
property string toolchainPrefix
property path toolchainInstallPath
compilerName: 'g++'
+ linkerName: "g++"
property string archiverName: 'ar'
property path sysroot: qbs.sysroot
property path platformPath
@@ -30,6 +31,7 @@ CppModule {
}
compilerPath: toolchainPathPrefix + compilerName
+ linkerPath: toolchainPathPrefix + linkerName
property path archiverPath: { return toolchainPathPrefix + archiverName }
readonly property bool shouldCreateSymlinks: {
@@ -135,7 +137,7 @@ CppModule {
args.push(libFilePath);
args = args.concat(Gcc.libraryLinkerFlags(product, inputs));
args = args.concat(Gcc.additionalCompilerAndLinkerFlags(product));
- var cmd = new Command(ModUtils.moduleProperty(product, "compilerPath"), args);
+ var cmd = new Command(ModUtils.moduleProperty(product, "linkerPath"), args);
cmd.description = 'linking ' + FileInfo.fileName(libFilePath);
cmd.highlight = 'linker';
cmd.responseFileUsagePrefix = '@';
@@ -262,7 +264,7 @@ CppModule {
args = args.concat(Gcc.libraryLinkerFlags(product, inputs));
args = args.concat(Gcc.additionalCompilerAndLinkerFlags(product));
- var cmd = new Command(ModUtils.moduleProperty(product, "compilerPath"), args);
+ var cmd = new Command(ModUtils.moduleProperty(product, "linkerPath"), args);
cmd.description = 'linking ' + FileInfo.fileName(output.fileName);
cmd.highlight = 'linker'
cmd.responseFileUsagePrefix = '@';
diff --git a/share/qbs/modules/cpp/msvc.js b/share/qbs/modules/cpp/msvc.js
index f71b3db99..01986c16e 100644
--- a/share/qbs/modules/cpp/msvc.js
+++ b/share/qbs/modules/cpp/msvc.js
@@ -196,7 +196,7 @@ function prepareLinker(product, inputs, outputs, libraryPaths, dynamicLibraries,
args = args.concat(linkerFlags);
var commands = [];
- var cmd = new Command("link.exe", args)
+ var cmd = new Command(product.moduleProperty("cpp", "linkerPath"), args)
cmd.description = 'linking ' + FileInfo.fileName(primaryOutput.fileName)
cmd.highlight = 'linker';
cmd.workingDirectory = FileInfo.path(primaryOutput.fileName)
diff --git a/share/qbs/modules/cpp/windows-msvc.qbs b/share/qbs/modules/cpp/windows-msvc.qbs
index 079795558..783cc5793 100644
--- a/share/qbs/modules/cpp/windows-msvc.qbs
+++ b/share/qbs/modules/cpp/windows-msvc.qbs
@@ -17,6 +17,7 @@ CppModule {
compilerDefines: ['_WIN32']
warningLevel: "default"
compilerName: "cl.exe"
+ linkerName: "link.exe"
property bool generateManifestFiles: true
property path toolchainInstallPath