Setup rpaths only for dynamic libraries.

Property to disable the use of rpath.
This commit is contained in:
Roman Telezhynskyi 2023-01-09 12:16:36 +02:00
parent 11642ebfe1
commit 2221a35e7b
3 changed files with 21 additions and 7 deletions

View File

@ -10,11 +10,15 @@ CppApplication {
cpp.minimumMacosVersion: buildconfig.minimumMacosVersion
}
cpp.rpaths: FileInfo.joinPaths(cpp.rpathOrigin,
"..",
qbs.targetOS.contains("macos")
? "Frameworks"
: buildconfig.installLibraryPath)
Properties {
condition: buildconfig.enableRPath
cpp.rpaths: FileInfo.joinPaths(cpp.rpathOrigin,
"..",
qbs.targetOS.contains("macos")
? "Frameworks"
: buildconfig.installLibraryPath)
}
install: true
installDir: buildconfig.installAppPath
installDebugInformation: true

View File

@ -10,8 +10,14 @@ Library {
buildconfig.appTarget: "valentina"
bundle.isBundle: buildconfig.frameworksBuild
cpp.includePaths: [".."]
cpp.sonamePrefix: qbs.targetOS.contains("macos") ? "@rpath" : undefined
cpp.rpaths: cpp.rpathOrigin
// Allow MAC OS X to find library inside a bundle
cpp.sonamePrefix: (!buildconfig.staticBuild && qbs.targetOS.contains("macos")) ? "@rpath" : undefined
Properties {
condition: (!buildconfig.staticBuild && buildconfig.enableRPath)
cpp.rpaths: cpp.rpathOrigin
}
install: !buildconfig.staticBuild
installDir: buildconfig.installLibraryPath

View File

@ -12,6 +12,10 @@ Module {
// Use this property to disable building unit tests.
property bool enableUnitTests: true
// Use this property to disable the use of rpath. This can be used when packaging Valentina for distributions which
// do not permit the use of rpath, such as Fedora.
property bool enableRPath: true
property string libDirName: "lib"
property string appTarget