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

"New Project" wizard is not creating configuration properties correctly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 2.5.2
    • Fix Version/s: None
    • Component/s: Qt/MSBuild
    • Labels:
      None
    • Environment:
      Visual Studio 2017
    • Platform/s:
      Windows

      Description

      When creating a new (non Qt) project using the stock Visual Studio project wizard, it sets up a block of properties for every build configuration in the .vcxproj, for example:

      <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
        <ConfigurationType>Application</ConfigurationType>
        <UseDebugLibraries>true</UseDebugLibraries>
        <PlatformToolset>v141</PlatformToolset>
        <CharacterSet>MultiByte</CharacterSet>
      </PropertyGroup>
      <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
        <ConfigurationType>Application</ConfigurationType>
        <UseDebugLibraries>false</UseDebugLibraries>
        <PlatformToolset>v141</PlatformToolset>
        <WholeProgramOptimization>true</WholeProgramOptimization>
        <CharacterSet>MultiByte</CharacterSet>
      </PropertyGroup>
      

      When using the Qt project wizard provided by the Qt VS Tools, it only sets up a subset of these properties:

      <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|Win32'" Label="Configuration">
        <ConfigurationType>Application</ConfigurationType>
        <PlatformToolset>v141</PlatformToolset>
      </PropertyGroup>
      <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|Win32'" Label="Configuration">
        <ConfigurationType>Application</ConfigurationType>
        <PlatformToolset>v141</PlatformToolset>
      </PropertyGroup>
      

      Note that "UseDebugLibraries", "CharacterSet" and "WholeProgramOptimization" are missing.

      This causes various issues:

      • "UseDebugLibraries" is used by VS to switch between Debug and Release Runtime Library and Optimization Settings, which doesn't work without this property. The Qt VS Tools work around this issue by explicitly specifying all the individual build settings like "RuntimeLibrary", "Optimization", "DebugInformationFormat", etc.. (which don't match the VS defaults in all cases). It would be much better to just use the default VS behavior by setting "UseDebugLibraries"
      • "WholeProgramOptimization" enables Link Time Code Generation for Release Builds. Because this property is missing for Qt projects, LTCG is disabled.
      • "CharacterSet" explicitly defines the Windows character set. Not so much of an issue for Qt projects.

      These inconsistencies cause various issues when maintaining a large code base with various Qt and non-Qt projects, because every Qt projects differs from all the other non-Qt projects and need to be adjusted manually.

      In conclusion: Qt VS Tools should set all the configuration properties just like the VS built-in project wizards do. On the other end, the Qt Wizard should NOT set all the individual, hand-crafted build properties (RuntimeLibrary, DebugInformationFormat, ...)  that are currently set to work-around the issue (and conflict with the VS defaults provided by Microsoft property sheets).

        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:
            fgross Florian Groß
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes