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

Allow project-wide module preferences in a dedicated item

    XMLWordPrintable

Details

    • cccf7a64cb312e6dfb89343cc6087d43cdfeb427

    Description

      Compiling projects for embedded systems requires often lots of compiler flags. These flags might be very specific to each project, platform and toolchain. In projects with multiple products, I find myself often struggling with the definition of project-specific compiler flags.

      Different solutions exist for that problem:

      1. Add common flags to toolchain profiles. While this approach seems natural for toolchain-specific properties, it fails when they become too project-specific. Maintaining toolchain profiles is also cumbersome when having multiple machines for development, test, and deployment.
      2. Create a shell wrapper script for qbs that assigns common module properties via command line. This feels actually more like a hack, but is quite efficient.
      3. Define custom properties in the project item and let each product assign these properties to the appropriate modules. This approach requires unnecessary work.
      4. Define a project-wide base product item with all common compiler flags and derive every product from that. Thanks to the Properties item, this solution is quite readable, but the base item is still somehow hidden.
      5. A combination of the previous two.
      6. ?

      I find each approach tedious in its own way and therefore propose a Qbs item for project-wide module preferences. This would require the least effort while providing maximum transparency.

      Such a Preferences item should provide at least the following properties:

      • bool condition: If false, the preferences will not be applied.
      • stringList profiles: The profiles to which which the preferences are applied.

      Example:

      Preferences {
          Affects { name : "cpp" }
          cpp.commonCompilerFlags : "blabla"
      }
      

      Attachments

        Issue Links

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

          Activity

            People

              jbornema Joerg Bornemann
              rweickelt Richard Weickelt
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes