Skip to content

NuGet package: CppWinRTPrecompiledHeader should be "." when not using PCH #1072

@davidmatson

Description

@davidmatson

In Microsoft.Windows.CppWinRT.targets, in this part of the code:

        <PropertyGroup Condition="('$(CppWinRTOverrideSDKReferences)' == 'true') or ('$(TargetPlatformVersion)' &gt; '10.0.17708.0')">
            <CppWinRTUsePrefixes Condition="'$(CppWinRTUsePrefixes)' == ''">true</CppWinRTUsePrefixes>
            <CppWinRTPrecompiledHeader Condition="'$(CppWinRTPrecompiledHeader)' == ''">$(_PCH)</CppWinRTPrecompiledHeader>
        </PropertyGroup>

Should likely be something like this:

            <CppWinRTPrecompiledHeader Condition="'$(CppWinRTPrecompiledHeader)' == '' and '$(UsePCH)' == 'true'">$(_PCH)</CppWinRTPrecompiledHeader>
            <CppWinRTPrecompiledHeader Condition="'$(CppWinRTPrecompiledHeader)' == '' and '$(UsePCH)' == 'false'">.</CppWinRTPrecompiledHeader>

(Otherwise, when the project has PCH disabled, the generated code fails to compile.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions