diff options
Diffstat (limited to 'share')
-rw-r--r-- | share/qbs/modules/cpp/CppModule.qbs | 6 | ||||
-rw-r--r-- | share/qbs/modules/cpp/GenericGCC.qbs | 2 | ||||
-rw-r--r-- | share/qbs/modules/cpp/msvc.js | 3 |
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])) |