diff options
Diffstat (limited to 'QtMSBuild/QtMsBuild/qt_private.props')
-rw-r--r-- | QtMSBuild/QtMsBuild/qt_private.props | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/QtMSBuild/QtMsBuild/qt_private.props b/QtMSBuild/QtMsBuild/qt_private.props index 30cc52c6..f688ae1e 100644 --- a/QtMSBuild/QtMsBuild/qt_private.props +++ b/QtMSBuild/QtMsBuild/qt_private.props @@ -196,6 +196,43 @@ <!-- ///////////////////////////////////////////////////////////////////////////////////////////////// + // Figure out depending on the user settings if we need to link the .natvis file into the PDB + // file. Reads the content of qconfig.pri to find Qt's namespace if set. Predefines the path to + // the .natvis file used during link which corresponds to the final output generated by the + // QtNatvis target. + // Evaluation order: first look at the project settings, if empty take from the global settings. + // --> + <PropertyGroup> + <LinkNatvisFile>$(QtLinkNatvisFile)</LinkNatvisFile> + </PropertyGroup> + <PropertyGroup Condition="'$(QtLinkNatvisFile)' == ''"> + <LinkNatvisRegValue>$([MSBuild]::GetRegistryValue( + 'HKEY_CURRENT_USER\SOFTWARE\Digia\Qt5VS2017','LinkNatvis' + ))</LinkNatvisRegValue> + <LinkNatvisFile>true</LinkNatvisFile> + <LinkNatvisFile Condition="'$(LinkNatvisRegValue)' == '0'">false</LinkNatvisFile> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)' == 'Debug' AND '$(LinkNatvisFile)' == 'true'"> + <NatvisLinkFile>$(IntDir)\qt.natvis</NatvisLinkFile> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)' == 'Debug' + AND '$(LinkNatvisFile)' == 'true' AND '$(QtInstallDir)' != ''"> + <QConfigPriPath>$([System.IO.Path]::Combine('$(QtInstallDir)', + 'mkspecs', 'qconfig.pri' + ))</QConfigPriPath> + <QConfigPriContent>$([MSBuild]::Unescape( + $([System.IO.File]::ReadAllText('$(QConfigPriPath)') + .Replace('
', ';') + .Replace(' =', '=') + .Replace('= ', '=')) + ));</QConfigPriContent> + <QtNamespace>$([System.Text.RegularExpressions.Regex]::Match($(QConfigPriContent), + 'QT_NAMESPACE=([a-zA-Z0-9]+);').get_Groups().get_Item(1) + )</QtNamespace> + </PropertyGroup> + + <!-- + ///////////////////////////////////////////////////////////////////////////////////////////////// // Default item metadata // --> <ItemDefinitionGroup> @@ -222,7 +259,10 @@ >%(SharedLibrarySearchPath);$(Qt_LIBPATH_)</SharedLibrarySearchPath> <AdditionalOptions Condition="'$(Qt_LINK_OPTIONS_)' != ''" >$(Qt_LINK_OPTIONS_) %(AdditionalOptions)</AdditionalOptions> + <AdditionalOptions Condition="'$(Configuration)' == 'Debug' AND '$(LinkNatvisFile)' == 'true'" + >/NATVIS:$(NatvisLinkFile) %(AdditionalOptions)</AdditionalOptions> </Link> + </ItemDefinitionGroup> <!-- |