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

Extra compiler-generated c++ files with non-.cpp extensions don't get compiled in vcxproj

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.9.2
    • Fix Version/s: 5.11.2
    • Component/s: Build tools: qmake
    • Labels:
      None
    • Platform/s:
      Windows
    • Commits:
      7dc930d40037c99d87b09de09a882d5f86f157d5

      Description

      When a custom compiler (as added by QMAKE_EXTRA_COMPILERS) produces as output a C++ source file with extension other than .cpp, and adds it to GENERATED_SOURCES variable, qmake vcxproj generator adds it to Generated Files folder of the project, but the file doesn't in fact get compiled.

      For example, Google protobuf compiler (protoc) generates source files with .cc extensions.

      The problem appears to be in VCXProjectWriter::outputFileConfig in msbuild_objectmodel.cc. There's a special case there (look for filePath.endsWith(".cpp") ) that generates ClCompile tag, while for other extensions CustomBuild tag is generated - but no actual custom action, so the file doesn't get compiled at all.

      The logic here should probably agree with that of VcprojGenerator::hasBuiltinCompiler, which uses Option::cpp_ext to check for C++ sources.

        Attachments

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

          Activity

            People

            Assignee:
            jbornema Joerg Bornemann
            Reporter:
            itandetnik Igor Tanditnik
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes