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

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.11.2
    • 5.9.2
    • Build tools: qmake
    • None
    • Windows
    • 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

        For Gerrit Dashboard: QTBUG-69770
        # Subject Branch Project Status CR V

        Activity

          People

            jbornema Joerg Bornemann
            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