Uploaded image for project: 'Qbs ("Cubes")'
  1. Qbs ("Cubes")
  2. QBS-711

Properties problem when no correct condition

    XMLWordPrintable

Details

    • 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

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            jbornema Joerg Bornemann
            vitaly@qubyx.com Vitaly Bondar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes