Skip to content

Commit c4be474

Browse files
authored
Only run Exec when we have inputs. (#455)
* Only run Exec when we have inputs. * Add missing quote.
1 parent 5cf7854 commit c4be474

File tree

3 files changed

+13
-20
lines changed

3 files changed

+13
-20
lines changed

nuget/Microsoft.Windows.CppWinRT.targets

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,9 @@ $(XamlMetaDataProviderPch)
463463
File="$(IntDir)mdmerge.rsp" Lines="$(_MdMergeParameters)"
464464
ContinueOnError="true" Overwrite="true" />
465465
<MakeDir Directories="$(CppWinRTUnmergedDir);$(CppWinRTMergedDir)" />
466-
<Message Text="$(_MdMergeCommand)" Importance="$(CppWinRTVerbosity)"/>
467-
<Exec Command="$(_MdMergeCommand)" />
466+
<Message Text="$(_MdMergeCommand)" Importance="$(CppWinRTVerbosity)" Condition="'@(CppWinRTMdMergeInputs)' != ''" />
467+
<!-- Only run mdmerge.exe when we actually have inputs -->
468+
<Exec Command="$(_MdMergeCommand)" Condition="'@(CppWinRTMdMergeInputs)' != ''" />
468469
<ItemGroup>
469470
<_MdMergedOutput Remove="@(_MdMergedOutput)"/>
470471
<_MdMergedOutput Include="$(CppWinRTMergedDir)*.winmd"/>
@@ -508,8 +509,8 @@ $(XamlMetaDataProviderPch)
508509
<WriteLinesToFile
509510
File="$(IntDir)cppwinrt_plat.rsp" Lines="$(_CppwinrtParameters)"
510511
ContinueOnError="true" Overwrite="true" />
511-
<Message Text="$(CppWinRTCommand)" Importance="$(CppWinRTVerbosity)"/>
512-
<Exec Command="$(CppWinRTCommand)" />
512+
<Message Text="$(CppWinRTCommand)" Importance="$(CppWinRTVerbosity)" Condition="'@(_CppwinrtInputs)' != ''" />
513+
<Exec Command="$(CppWinRTCommand)" Condition="'@(_CppwinrtInputs)' != ''" />
513514
</Target>
514515

515516
<!--Build reference projection from WinMD project references and dynamic library project references-->
@@ -539,8 +540,8 @@ $(XamlMetaDataProviderPch)
539540
<WriteLinesToFile
540541
File="$(IntDir)cppwinrt_ref.rsp" Lines="$(_CppwinrtParameters)"
541542
ContinueOnError="true" Overwrite="true" />
542-
<Message Text="$(CppWinRTCommand)" Importance="$(CppWinRTVerbosity)"/>
543-
<Exec Command="$(CppWinRTCommand)" />
543+
<Message Text="$(CppWinRTCommand)" Importance="$(CppWinRTVerbosity)" Condition="'@(_CppwinrtRefInputs)' != ''" />
544+
<Exec Command="$(CppWinRTCommand)" Condition="'@(_CppwinrtRefInputs)' != ''" />
544545
</Target>
545546

546547
<!--Build component projection from project WinMD file and static library project references-->

test/nuget/Directory.Build.props

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
<!-- Build overrides the roots. -->
1212
<GenerateProjectSpecificOutputFolder>false</GenerateProjectSpecificOutputFolder>
1313
<OutDirWasSpecified>true</OutDirWasSpecified>
14-
<OutDirRoot Condition="'$(OutDirRoot)' == ''" >$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDirRoot>
15-
<OutDir>$(OutDirRoot)$(MSBuildProjectName)\</OutDir>
16-
<IntDirRoot Condition="'$(IntDirRoot)' == ''" >$(SolutionDir)obj\$(Platform)\$(Configuration)\</IntDirRoot>
17-
<IntDir>$(IntDirRoot)$(MSBuildProjectName)\</IntDir>
14+
<OutDirRoot Condition="'$(OutDirRoot)' == ''">$(SolutionDir)bin\</OutDirRoot>
15+
<OutDir>$(OutDirRoot)$(Configuration)\$(PlatformDirectoryName)\$(MSBuildProjectName)\</OutDir>
16+
<OutputPath>$(OutDir)</OutputPath>
17+
<IntDirRoot Condition="'$(IntDirRoot)' == ''" >$(SolutionDir)obj\</IntDirRoot>
18+
<IntDir>$(IntDirRoot)$(Configuration)\$(PlatformDirectoryName)\$(MSBuildProjectName)\</IntDir>
19+
<IntermediateOutputPath>$(IntDir)</IntermediateOutputPath>
1820
<GeneratedFilesDir>$(IntDir)Generated Files\</GeneratedFilesDir>
1921
<CppWinRTVerbosity>high</CppWinRTVerbosity>
2022
<CppWinRTPlatform>$(Platform)</CppWinRTPlatform>

test/nuget/TestRuntimeComponentCSharp/TestRuntimeComponentCSharp.csproj

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
<DebugSymbols>true</DebugSymbols>
2424
<DebugType>full</DebugType>
2525
<Optimize>false</Optimize>
26-
<OutputPath>bin\Debug\</OutputPath>
2726
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
2827
<ErrorReport>prompt</ErrorReport>
2928
<WarningLevel>4</WarningLevel>
@@ -32,15 +31,13 @@
3231
<PlatformTarget>AnyCPU</PlatformTarget>
3332
<DebugType>pdbonly</DebugType>
3433
<Optimize>true</Optimize>
35-
<OutputPath>bin\Release\</OutputPath>
3634
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
3735
<ErrorReport>prompt</ErrorReport>
3836
<WarningLevel>4</WarningLevel>
3937
</PropertyGroup>
4038
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
4139
<PlatformTarget>x86</PlatformTarget>
4240
<DebugSymbols>true</DebugSymbols>
43-
<OutputPath>bin\x86\Debug\</OutputPath>
4441
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
4542
<NoWarn>;2008</NoWarn>
4643
<DebugType>full</DebugType>
@@ -49,7 +46,6 @@
4946
</PropertyGroup>
5047
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
5148
<PlatformTarget>x86</PlatformTarget>
52-
<OutputPath>bin\x86\Release\</OutputPath>
5349
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
5450
<Optimize>true</Optimize>
5551
<NoWarn>;2008</NoWarn>
@@ -60,7 +56,6 @@
6056
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
6157
<PlatformTarget>ARM</PlatformTarget>
6258
<DebugSymbols>true</DebugSymbols>
63-
<OutputPath>bin\ARM\Debug\</OutputPath>
6459
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
6560
<NoWarn>;2008</NoWarn>
6661
<DebugType>full</DebugType>
@@ -69,7 +64,6 @@
6964
</PropertyGroup>
7065
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
7166
<PlatformTarget>ARM</PlatformTarget>
72-
<OutputPath>bin\ARM\Release\</OutputPath>
7367
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
7468
<Optimize>true</Optimize>
7569
<NoWarn>;2008</NoWarn>
@@ -80,7 +74,6 @@
8074
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM64'">
8175
<PlatformTarget>ARM64</PlatformTarget>
8276
<DebugSymbols>true</DebugSymbols>
83-
<OutputPath>bin\ARM64\Debug\</OutputPath>
8477
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
8578
<NoWarn>;2008</NoWarn>
8679
<DebugType>full</DebugType>
@@ -89,7 +82,6 @@
8982
</PropertyGroup>
9083
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM64'">
9184
<PlatformTarget>ARM64</PlatformTarget>
92-
<OutputPath>bin\ARM64\Release\</OutputPath>
9385
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
9486
<Optimize>true</Optimize>
9587
<NoWarn>;2008</NoWarn>
@@ -100,7 +92,6 @@
10092
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
10193
<PlatformTarget>x64</PlatformTarget>
10294
<DebugSymbols>true</DebugSymbols>
103-
<OutputPath>bin\x64\Debug\</OutputPath>
10495
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
10596
<NoWarn>;2008</NoWarn>
10697
<DebugType>full</DebugType>
@@ -109,7 +100,6 @@
109100
</PropertyGroup>
110101
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
111102
<PlatformTarget>x64</PlatformTarget>
112-
<OutputPath>bin\x64\Release\</OutputPath>
113103
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
114104
<Optimize>true</Optimize>
115105
<NoWarn>;2008</NoWarn>

0 commit comments

Comments
 (0)