Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.9.2
-
None
-
-
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 |
236136,3 | qmake vcxproj generator: Fix compilation of generated C++ sources | 5.11 | qt/qtbase | Status: MERGED | +2 | 0 |