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

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Fixed
    • Affects Version/s: 2.2.2
    • Fix Version/s: 2.3.1
    • Component/s: Build-time integration
    • Labels:
      None
    • Environment:
      Visual Studio 2017
      vcxproj is in VS2013 format

      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

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes