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

VS: EXTRA_COMPILERs incorrectly generated if output name is generated by function

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 5.4.1
    • Fix Version/s: 5.5.0 Beta
    • Component/s: Build tools: qmake
    • Labels:
      None
    • Environment:
      Windows, VS
    • Commits:
      3c1cb24fe4c0cde0cfe4b18f13fea4966ace8a41

      Description

      QMAKE_EXTRA_COMPILERs are not correctly generated in VS projects if the output name is generated by a function.

      TEMPLATE = app
      FUNNY_COMPILER_FILES = foo.txt
      
      defineReplace(funnyCompilerOutputName) {
          name = $$absolute_path($$1, $$OUT_PWD)
          name = $$relative_path($$name, $$_PRO_FILE_PWD_)
          name = $$replace(name, \\.txt$, _txt)
          name = $${name}$${first(QMAKE_EXT_CPP)}
          name = $$replace(name,/,_)
          return($${name})
      }
      
      funnycompiler.input = FUNNY_COMPILER_FILES
      funnycompiler.output = ${QMAKE_FUNC_FILE_IN_funnyCompilerOutputName}
      funnycompiler.commands = copy ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
      funnycompiler.variable_out = GENERATED_SOURCES
      funnycompiler.dependency_type = TYPE_C
      QMAKE_EXTRA_COMPILERS += funnycompiler
      

      In VcprojGenerator::initExtraCompilerOutputs() there's a call to hasBuiltinCompiler which checks if outputs have a known file extension such as ".cpp".
      But the function sees the unevaluated string

      "${QMAKE_FUNC_FILE_IN_funnyCompilerOutputName}"
      

      and fails to recognize that the EXTRA_COMPILER generates 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:
            jbornema Joerg Bornemann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes