Uploaded image for project: 'Qt Visual Studio Tools'
  1. Qt Visual Studio Tools
  2. QTVSADDINBUG-583

Preprocessor list containing values with spaces not parsing properly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 2.3.1
    • 2.2.2
    • Build-time integration
    • None
    • Visual Studio 2017
      vcxproj is in VS2013 format
    • Windows
    • 4d33c9b97a557713dce4c1eca6e42785a07f6bec

    Description

      Our build configuration has a variable defined that contains a space:

      $(BuildTime) = "1900/01/01 00:00:00"

      Our preprocessor definition list in MSBuild uses this variable:

      <ItemDefinitionGroup><ClCompile>...
      <PreprocessorDefinitions>...some... ;BUILD_TIME="$(BuildTime)";PRODUCT_NAME="$(BuildName)";...more... </PreprocessorDefinitions>
      ...</ClCompile></ItemDefinitionGroup>

      After switching to use Qt/MSBuild, we're seeing a weird phenomenon happening in the QtMoc entries in our vcxproj.

      <QtMoc Include="Test.h">
      <InputFile Condition="...">00:00:00 -DPRODUCT_NAME=cderochie Build...</InputFile>
      <Define Condition="...">...;BUILD_TIME=1900/01/01</Define>
      ...
      </QtMoc>

       You'll notice the InputFile tag continues from where the Define tag prematurely ends, except formatted as a command line instead of semi-colonated list. This causes the build to fail.

      As an aside, I'd prefer it not add these tags at all to the QtMoc items, or at least not expand the variable values. Many of these variables' values are provided by our CI system and I don't want to commit them to our repo with their values hard-coded as you can see in my example. The problem of this variable expansion seems to have existed since at least 2.0.0 in both Qt/MSBuild and the old CustomBuild way. Can I turn it off somehow? That would give me a workaround.

      Attachments

        Activity

          People

            mecfc Miguel Costa
            seisware.cderochie Corey Derochie
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: