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

cpp.link dependency parameter doesn't work as expected in transitive cases

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 3.0.0
    • None
    • All

    Description

      Project {
          property string file: "path/to/source.cc"    
          
          StaticLibrary {
              name: "hal"
              Depends { name: "cpp" }
              files: project.file
      
              // The only way to prevent hal from being linked in app
              // Export {
              //    Depends { name: "cpp" }
              //    Parameters {
              //        cpp.link: false
              //    }
              // }
          }    
       
          StaticLibrary {
              name: "middleware"
              Depends { name: "cpp" }
              Depends { name: "hal" }
              files: project.file
          } 
          Application {
              name: "app"
              Depends { name: "cpp" }
              Depends { name: "hal"; cpp.link: false }
              Depends { name: "middleware" }
              files: project.file
          }
      }

      Expected behavior:

      • app does not link to lib hal
      • scalar dependency parameters in "app" (final product) should always take precedence over dependency parameters further down the line

      Actual behavior:

      • app is linked to lib hal
      • cpp.link doesn't have any effect when setting it to false in lib middleware either
      • cpp.link has only an effect when explicitly setting it in lib hal's Export item like shown above or when removing middleware's dependency on hal and leaving app as the only consumer.

      App in this case is a test application that mocks lib hal. In this special case, symbols of lib hal will be overridden anyway, so it's not dramatic. But symbols that are not overridden by app will silently link to lib hal which is not what I want. Anyway, the way it currently works is surprising and unexpected.

      Attachments

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

        Activity

          People

            kandeler Christian Kandeler
            rweickelt Richard Weickelt
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes