Commit 588a058d9bb0aeffe500686a2d2b4db0e9cddd71

Alexei Podtelezhnikov 2021-11-02T22:51:51

[builds/windows] Let MSBuild handle DLG copy. * builds/windows/vc2010/freetype.vcxproj: Specify DlgCopy target. * builds/windows/vc2010/script.bat: Deleted.

diff --git a/builds/windows/vc2010/freetype.vcxproj b/builds/windows/vc2010/freetype.vcxproj
index ff901e9..ccabbd4 100644
--- a/builds/windows/vc2010/freetype.vcxproj
+++ b/builds/windows/vc2010/freetype.vcxproj
@@ -144,9 +144,6 @@
       <AdditionalLibraryDirectories>$(UserLibraryDirectories);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
       <AdditionalDependencies>$(UserDependencies);%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
-    <PreBuildEvent>
-      <Command>call $(SolutionDir)script.bat</Command>
-    </PreBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
     <ClCompile>
@@ -174,9 +171,6 @@
       <AdditionalLibraryDirectories>$(UserLibraryDirectories);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
       <AdditionalDependencies>$(UserDependencies);%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
-    <PreBuildEvent>
-      <Command>call $(SolutionDir)script.bat</Command>
-    </PreBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <ClCompile>
@@ -204,9 +198,6 @@
       <AdditionalLibraryDirectories>$(UserLibraryDirectories);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
       <AdditionalDependencies>$(UserDependencies);%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
-    <PreBuildEvent>
-      <Command>call $(SolutionDir)script.bat</Command>
-    </PreBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|Win32'">
     <ClCompile>
@@ -233,9 +224,6 @@
       <AdditionalLibraryDirectories>$(UserLibraryDirectories);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
       <AdditionalDependencies>$(UserDependencies);%(AdditionalDependencies)</AdditionalDependencies>
     </Lib>
-    <PreBuildEvent>
-      <Command>call $(SolutionDir)script.bat</Command>
-    </PreBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|ARM64'">
     <ClCompile>
@@ -262,9 +250,6 @@
       <AdditionalLibraryDirectories>$(UserLibraryDirectories);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
       <AdditionalDependencies>$(UserDependencies);%(AdditionalDependencies)</AdditionalDependencies>
     </Lib>
-    <PreBuildEvent>
-      <Command>call $(SolutionDir)script.bat</Command>
-    </PreBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|x64'">
     <ClCompile>
@@ -291,9 +276,6 @@
       <AdditionalLibraryDirectories>$(UserLibraryDirectories);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
       <AdditionalDependencies>$(UserDependencies);%(AdditionalDependencies)</AdditionalDependencies>
     </Lib>
-    <PreBuildEvent>
-      <Command>call $(SolutionDir)script.bat</Command>
-    </PreBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <ClCompile>
@@ -506,6 +488,17 @@
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
+  <ItemGroup>
+    <DlgSrc Include="..\..\..\subprojects\dlg\include\dlg\output.h" />
+    <DlgDst Include="..\..\..\include\dlg\output.h" />
+    <DlgSrc Include="..\..\..\subprojects\dlg\include\dlg\dlg.h" />
+    <DlgDst Include="..\..\..\include\dlg\dlg.h" />
+    <DlgSrc Include="..\..\..\subprojects\dlg\src\dlg\dlg.c" />
+    <DlgDst Include="..\..\..\src\dlg\dlg.c" />
+  </ItemGroup>
+  <Target Name="DlgCopy" Inputs="@(DlgSrc)" Outputs="@(DlgDst)" BeforeTargets="PrepareForBuild">
+    <Copy SourceFiles="@(DlgSrc)" DestinationFiles="@(DlgDst)" SkipUnchangedFiles="true" />
+  </Target>
   <Target Name="AfterBuild">
     <ItemGroup>
       <TargetFiles Include="$(TargetDir)$(TargetName).*" />
diff --git a/builds/windows/vc2010/script.bat b/builds/windows/vc2010/script.bat
deleted file mode 100644
index 8c900e6..0000000
--- a/builds/windows/vc2010/script.bat
+++ /dev/null
@@ -1,11 +0,0 @@
-@echo OFF
-
-:: Move to Top Dir
-cd ..\..\..\
-
-:: Copy dlg's files from `subprojects\dlg' to `src\dlg'
-IF NOT EXIST include\dlg (
-	mkdir include\dlg
-	COPY subprojects\dlg\include\dlg\dlg.h include\dlg
-	COPY subprojects\dlg\include\dlg\output.h include\dlg
-	COPY subprojects\dlg\src\dlg\dlg.c src\dlg\ )