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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.5.0 Beta
    • 5.4.1
    • Build tools: qmake
    • None
    • Windows, VS
    • 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

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

        Activity

          People

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