aboutsummaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@digia.com>2014-06-02 11:41:19 +0200
committerJoerg Bornemann <joerg.bornemann@digia.com>2014-06-02 16:49:27 +0200
commit96d09509e46b2c15b646b81725bdc6ec18118283 (patch)
treed81cfad407ce97af280af65c6701668280cf7fe2 /share
parent0d17c9617e1478951ea8e967937adb7d16a8e3b3 (diff)
introduce cpp.entryPoint
Set cpp.entryPoint to specify the entry point symbol for an executable or dynamic library. Task-number: QBS-602 Change-Id: I83e7c13b4ab7675a1cfa0cc8a2234cba0f850b3d Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
Diffstat (limited to 'share')
-rw-r--r--share/qbs/modules/cpp/CppModule.qbs6
-rw-r--r--share/qbs/modules/cpp/GenericGCC.qbs2
-rw-r--r--share/qbs/modules/cpp/msvc.js3
3 files changed, 11 insertions, 0 deletions
diff --git a/share/qbs/modules/cpp/CppModule.qbs b/share/qbs/modules/cpp/CppModule.qbs
index 7634b8495..394568238 100644
--- a/share/qbs/modules/cpp/CppModule.qbs
+++ b/share/qbs/modules/cpp/CppModule.qbs
@@ -150,6 +150,12 @@ Module {
description: "generate position independent code"
}
+ property string entryPoint
+ PropertyOptions {
+ name: "entryPoint"
+ description: "entry point symbol for an executable or dynamic library"
+ }
+
property string visibility: 'default' // 'default', 'hidden', 'hiddenInlines'
PropertyOptions {
name: "visibility"
diff --git a/share/qbs/modules/cpp/GenericGCC.qbs b/share/qbs/modules/cpp/GenericGCC.qbs
index d20b69b35..04d0a636f 100644
--- a/share/qbs/modules/cpp/GenericGCC.qbs
+++ b/share/qbs/modules/cpp/GenericGCC.qbs
@@ -144,6 +144,8 @@ CppModule {
else
args.push('--sysroot=' + sysroot);
}
+ if (product.moduleProperty("cpp", "entryPoint"))
+ args.push("-Wl,-e", product.moduleProperty("cpp", "entryPoint"));
args.push('-o');
args.push(lib.filePath);
diff --git a/share/qbs/modules/cpp/msvc.js b/share/qbs/modules/cpp/msvc.js
index 9206eb941..03966234f 100644
--- a/share/qbs/modules/cpp/msvc.js
+++ b/share/qbs/modules/cpp/msvc.js
@@ -189,6 +189,9 @@ function prepareLinker(product, inputs, outputs, libraryPaths, dynamicLibraries,
args.push(dynamicLibrary)
}
+ if (product.moduleProperty("cpp", "entryPoint"))
+ args.push("/ENTRY:" + product.moduleProperty("cpp", "entryPoint"));
+
args.push('/OUT:' + linkerOutputNativeFilePath)
for (i in libraryPaths) {
args.push('/LIBPATH:' + FileInfo.toWindowsSeparators(libraryPaths[i]))