diff options
author | Jake Petroules <jake.petroules@qt.io> | 2016-12-06 12:44:35 -0800 |
---|---|---|
committer | Jake Petroules <jake.petroules@qt.io> | 2016-12-07 12:58:08 +0000 |
commit | 28af1e508aee74f90f718a082fe4095910e5a731 (patch) | |
tree | a2592813b2420485c8fa023584ff5fb38d0d873d /qbs-resources/imports | |
parent | a8df8bc969117eb49f13a65db5b7eeee45576afa (diff) | |
download | qbs-28af1e508aee74f90f718a082fe4095910e5a731.tar.gz |
Fix propagation of defines to dependencies from QbsLibrary
The Export of cpp.defines could not possibly have ever worked as triple
equals comparison of a string and array will always be false. Fix that,
and then fix the resultant build errors by avoiding the addition of
the QBS_STATIC_LIB define to an importing dynamic library, and warning
in the case where the same translation unit will be seen with different
visibility settings in different contexts.
This also fixes warnings in generator plugins due to the different
visibility.
Change-Id: Icf91bfd5644c436ddea819cce61b7a4b654c0db4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'qbs-resources/imports')
-rw-r--r-- | qbs-resources/imports/QbsLibrary.qbs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/qbs-resources/imports/QbsLibrary.qbs b/qbs-resources/imports/QbsLibrary.qbs index 5ad01e170..218da8941 100644 --- a/qbs-resources/imports/QbsLibrary.qbs +++ b/qbs-resources/imports/QbsLibrary.qbs @@ -8,13 +8,14 @@ QbsProduct { type: Qt.core.staticBuild ? "staticlibrary" : "dynamiclibrary" targetName: (qbs.enableDebugCode && qbs.targetOS.contains("windows")) ? (name + 'd') : name destinationDirectory: qbs.targetOS.contains("windows") ? "bin" : qbsbuildconfig.libDirName - cpp.defines: base.concat(type == "staticlibrary" ? ["QBS_STATIC_LIB"] : ["QBS_LIBRARY"]) + cpp.defines: base.concat(visibilityType === "static" ? ["QBS_STATIC_LIB"] : ["QBS_LIBRARY"]) cpp.sonamePrefix: qbs.targetOS.contains("darwin") ? "@rpath" : undefined // ### Uncomment the following line in 1.8 //cpp.soVersion: version.replace(/\.\d+$/, '') cpp.visibility: "minimal" cpp.cxxLanguageVersion: "c++11" bundle.isBundle: false + property bool visibilityType: Qt.core.staticBuild ? "static" : "dynamic" property string headerInstallPrefix: "/include/qbs" Group { fileTagsFilter: product.type.concat("dynamiclibrary_symlink") @@ -34,6 +35,6 @@ QbsProduct { cpp.rpaths: qbsbuildconfig.libRPaths cpp.includePaths: [product.sourceDirectory] - cpp.defines: product.type === "staticlibrary" ? ["QBS_STATIC_LIB"] : [] + cpp.defines: product.visibilityType === "static" ? ["QBS_STATIC_LIB"] : [] } } |