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

cannot set 'windowsApiCharacterSet' when Project depends on more than one module

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 1.1.0
    • 1.0.1
    • General
    • None
    • Windows 7 / MSVC
    • 7960eb7045bb2df04d7bbad42e46c3f559f976cd

    Description

      If a simple project depends only on the cpp module, one can set 'windowsApiCharacterSet:undefined' to get rid of the /DUNICODE and /D_UNICODE defines on windows. But this does not work, if there is an additional dependency to an other module, which depends itself on 'cpp':

      main.qbs
      import qbs 1.0
      Application {
        ...
        Depends { name: 'cpp' }
        Depends { name: 'myModule' }
      
        cpp.windowsApiCharacterSet: undefined
        ...
      }
      
      myModule.qbs
      import qbs 1.0
      Module {
        Depends { name: 'cpp' }
        ... // no further references to windowsApiCharacterSet here
      }
      

      In this example the generated compiler call still contains \DUNICODE and \D_UNICODE. This can only be stopped by adding an additional

        myModule.cpp.windowsApiCharacterSet: undefined
      

      into the Application block. So the author of "main.qbs" must know internal details about myModule to specify compiler flags.

      The reason for this may be in ...share/qbs/modules/cpp/windows-msvc.qbs because the lines

      windows-msvc.qbs
        windowsApiCharacterSet: "unicode"
        platformDefines: base.concat(Windows.characterSetDefines(windowsApiCharacterSet))
      

      are called three times when using the example above. (Put a print() into Windows.characterSetDefines() to prove it.) I guess: one call for initialising qbs itself, another for the 'Depends' in the Application block and the 3rd call for the 'Depends' in the module 'myModule'.

      Attachments

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

        Activity

          People

            jbornema Joerg Bornemann
            kukepsw Kurt Keller
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes