Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-115499

moc: The metatypes.json file is generated with ambiguous "inputFile" records.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 6.2, 6.5, 6.6
    • None
    • 6dda607f6 (dev), bfa3852bc (6.6)

      "inputFile" records in the generated metatypes.json files use the file name as the value. This is ambiguous since using subdirectories we can use the same file name but specify different content. The example project reproduces the invalid behavior. subdir/myclass.h end's up as "inputFile": "myclass.h" record in the metatypes.json file, so qmltyperegistrar generates the single include record for myclass.h and as the result compilation fails.

      The attached example is quite trivial, but in real projects subdir might reflect the inner namespace structure(this can happen in QtProtobuf for instance), so we definitely should consider subdirectories when generating metatypes.json.

      I suggest to add extra record to not break the dependent user projects, if they exist.

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

            qtbuildsystem Qt Build System Team
            semlanik Alexey Edelev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes