From 280b12ce9c474d11b0d7d8a18d690edcaad91004 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 12 Nov 2013 18:25:08 +0100 Subject: introduce cpp.linkerName and cpp.linkerPath Like the compilerName/Path, the linker must be configurable. Change-Id: I50f9511dedbff29dbf55b41b96e213f238be187f Reviewed-by: Christian Kandeler --- share/qbs/modules/cpp/CppModule.qbs | 2 ++ share/qbs/modules/cpp/GenericGCC.qbs | 6 ++++-- share/qbs/modules/cpp/msvc.js | 2 +- share/qbs/modules/cpp/windows-msvc.qbs | 1 + 4 files changed, 8 insertions(+), 3 deletions(-) (limited to 'share') 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 -- cgit v1.2.1