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

enableCompilerDefinesByLanguage is unknown at first start

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Not Evaluated
    • 2.5.1
    • 2.5.0
    • General
    • None
    • Linux/Wayland, macOS
    • b5d2eaa6f (2.5)

    Description

      Hi! I updated to qbs 2.5.0 and discover interesting bug. When I set cpp.enableCompilerDefinesByLanguage property it called twice and first value is unknown:

       

      example:

      Project {
          Product {
              Depends { name: "cpp" }
          
              cpp.enableCompilerDefinesByLanguage: {
                  console.warn(typeof base);
                  return base;
              }
          }
      } 

      Output:

      $ qbs profile:glibc-x86_64-gcc11
      Restoring build graph from disk Project file '/Users/lo1ol/Documents/work/unilogon/rtlogon.qbs' has changed.
      Resolving project for configuration default
      WARNING: unknown
      WARNING: object
      Build done for configuration default.
      Building for configuration default 

       

      It lead a bug for me, because I has this line in my project:

      cpp.enableCompilerDefinesByLanguage: base.concat(qbs.toolchain.contains("clang-cl") ? ["c"] : [])

       

      Btw, I found out a workardound and replace it to:

      cpp.enableCompilerDefinesByLanguage: {
          if (typeof base === "unknown")
             return base;
          return base.concat(qbs.toolchain.contains("clang-cl") ? ["c"] : []);
      } 

      Attachments

        For Gerrit Dashboard: QBS-1821
        # Subject Branch Project Status CR V

        Activity

          People

            kandeler Christian Kandeler
            lo1ol Petr Mikhalitsyn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes