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.minimumMacosVersion: buildconfig.minimumMacosVersion
} }
Properties {
condition: buildconfig.enableRPath
cpp.rpaths: FileInfo.joinPaths(cpp.rpathOrigin, cpp.rpaths: FileInfo.joinPaths(cpp.rpathOrigin,
"..", "..",
qbs.targetOS.contains("macos") qbs.targetOS.contains("macos")
? "Frameworks" ? "Frameworks"
: buildconfig.installLibraryPath) : buildconfig.installLibraryPath)
}
install: true install: true
installDir: buildconfig.installAppPath installDir: buildconfig.installAppPath
installDebugInformation: true installDebugInformation: true

View File

@ -10,8 +10,14 @@ Library {
buildconfig.appTarget: "valentina" buildconfig.appTarget: "valentina"
bundle.isBundle: buildconfig.frameworksBuild bundle.isBundle: buildconfig.frameworksBuild
cpp.includePaths: [".."] cpp.includePaths: [".."]
cpp.sonamePrefix: qbs.targetOS.contains("macos") ? "@rpath" : undefined
// 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 cpp.rpaths: cpp.rpathOrigin
}
install: !buildconfig.staticBuild install: !buildconfig.staticBuild
installDir: buildconfig.installLibraryPath installDir: buildconfig.installLibraryPath

View File

@ -12,6 +12,10 @@ Module {
// Use this property to disable building unit tests. // Use this property to disable building unit tests.
property bool enableUnitTests: true 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 libDirName: "lib"
property string appTarget property string appTarget