Details
-
Bug
-
Resolution: Done
-
P2: Important
-
1.3.2
-
None
-
d245f8b8787ccf4d9b28ab5032928bb8617bec90
Description
I made basic realization for libraries to move common defines etc. But faced with the strange problem.
Here is simplified example.
base:
import qbs 1.0 StaticLibrary { name: "baselibrary" Depends { name: "cpp" } Properties { condition: qbs.targetOS.contains("windows") cpp.cxxFlags: ["-std=c++0x"] cpp.minimumWindowsVersion: "5.1" } Properties { condition: qbs.targetOS.contains("osx") cpp.cxxFlags: ["-std=c++11", "-stdlib=libc++"] cpp.linkerFlags: ["-stdlib=libc++"] cpp.minimumOsxVersion: "10.7" } cpp.includePaths: ['..'] }
real library:
import qbs 1.0 import "../baselibrary.qbs" as baselibrary baselibrary { name: "SomeLib" Properties { condition: qbs.targetOS.contains("windows") cpp.cxxFlags: base.concat(["-U__STRICT_ANSI__"]) cpp.defines: base.concat(["WIN32"]) } Depends { name: "Qt.core" } files: [ "*.cpp", "*.h" ] }
When I use it on windows everthing is fine. But on MacOS cpp.cxxFlags becomes empty for this library.
The adding direct using of base values for osx solve problem:
import qbs 1.0 import "../baselibrary.qbs" as baselibrary baselibrary { name: "SomeLib" Properties { condition: qbs.targetOS.contains("windows") cpp.cxxFlags: base.concat(["-U__STRICT_ANSI__"]) cpp.defines: base.concat(["WIN32"]) } Properties { condition: qbs.targetOS.contains("osx") cpp.cxxFlags: base cpp.linkerFlags: base cpp.minimumOsxVersion: base } Depends { name: "Qt.core" } files: [ "*.cpp", "*.h" ] }
But as for me it looks not correct
Attachments
For Gerrit Dashboard: QBS-711 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
101933,3 | make "base" the default fallback for Properties blocks | master | qbs/qbs | Status: MERGED | +2 | 0 |