summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorArnavion <arnavion@gmail.com>2013-10-12 18:41:27 -0700
committerArnavion <arnavion@gmail.com>2013-10-12 18:41:27 -0700
commite2edbfe47d89059f2020baccd76ad4715ef87871 (patch)
treef1948820b339f513f036e62f04ebcd0ed9803085 /src
parent0061cd38d07396cfa42deaaa199c334b40f3d0d3 (diff)
win32: Use version information from configure.ac to populate the Windows-specific files that need it - config-win32.h, version.txt, hexchat.rc, hexchat.iss
This is done via T4 templates. The original files are now generated at build-time and so have been added to .gitignore and removed from the repository, with the exception of version.txt which must be hosted on GitHub for the updater plugin.
Diffstat (limited to 'src')
-rw-r--r--src/common/common.vcxproj16
-rw-r--r--src/fe-gtk/fe-gtk.vcxproj11
-rw-r--r--src/fe-gtk/hexchat.rc.tt (renamed from src/fe-gtk/hexchat.rc)5
3 files changed, 27 insertions, 5 deletions
diff --git a/src/common/common.vcxproj b/src/common/common.vcxproj
index bc2605dd..13610cee 100644
--- a/src/common/common.vcxproj
+++ b/src/common/common.vcxproj
@@ -14,7 +14,6 @@
     </ProjectConfiguration>

   </ItemGroup>

   <ItemGroup>

-    <ClInclude Include="..\..\config-win32.h" />

     <ClInclude Include="cfgfiles.h" />

     <ClInclude Include="chanopt.h" />

     <ClInclude Include="ctcp.h" />

@@ -75,6 +74,10 @@
     <ClCompile Include="util.c" />

     <ClCompile Include="hexchat.c" />

   </ItemGroup>

+  <ItemGroup>

+    <None Include="..\..\config-win32.h.tt" />

+    <ClInclude Include="..\..\config-win32.h" />

+  </ItemGroup>

   <PropertyGroup Label="Globals">

     <ProjectGuid>{87554B59-006C-4D94-9714-897B27067BA3}</ProjectGuid>

     <Keyword>Win32Proj</Keyword>

@@ -151,4 +154,15 @@
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

   <ImportGroup Label="ExtensionTargets">

   </ImportGroup>

+  <ItemDefinitionGroup>

+    <PreBuildEvent>

+      <Command>

+      <![CDATA[

+SET SOLUTIONDIR=$(SolutionDir)..\

+"%PROGRAMFILES%\Common Files\microsoft shared\TextTemplating\12.0\TextTransform.exe" -out "%SOLUTIONDIR%config-win32.h" "%SOLUTIONDIR%config-win32.h.tt"

+"%PROGRAMFILES%\Common Files\microsoft shared\TextTemplating\12.0\TextTransform.exe" -out "%SOLUTIONDIR%win32\version.txt" "%SOLUTIONDIR%win32\version.txt.tt"

+      ]]>

+      </Command>

+    </PreBuildEvent>

+  </ItemDefinitionGroup>

 </Project>
\ No newline at end of file
diff --git a/src/fe-gtk/fe-gtk.vcxproj b/src/fe-gtk/fe-gtk.vcxproj
index 73526766..7cc40da8 100644
--- a/src/fe-gtk/fe-gtk.vcxproj
+++ b/src/fe-gtk/fe-gtk.vcxproj
@@ -97,8 +97,14 @@
   </ItemDefinitionGroup>

   <ItemDefinitionGroup>

     <PreBuildEvent>

-      <Command>$(DepsRoot)\bin\glib-compile-resources.exe --generate-source --sourcedir $(DataDir) --target "$(ProjectDir)resources.c" "$(DataDir)hexchat.gresource.xml"</Command>

-      <Message>Build gresource file</Message>

+      <Command>

+      <![CDATA[

+SET SOLUTIONDIR=$(SolutionDir)..\

+"%PROGRAMFILES%\Common Files\microsoft shared\TextTemplating\12.0\TextTransform.exe" -out hexchat.rc hexchat.rc.tt

+$(DepsRoot)\bin\glib-compile-resources.exe --generate-source --sourcedir $(DataDir) --target "$(ProjectDir)resources.c" "$(DataDir)hexchat.gresource.xml"

+      ]]>

+      </Command>

+      <Message>Build hexchat.rc and gresource file</Message>

     </PreBuildEvent>

   </ItemDefinitionGroup>

   <ItemGroup>

@@ -166,6 +172,7 @@
     <Manifest Include="hexchat.exe.manifest" />

   </ItemGroup>

   <ItemGroup>

+    <None Include="hexchat.rc.tt" />

     <ResourceCompile Include="hexchat.rc" />

   </ItemGroup>

   <ItemGroup>

diff --git a/src/fe-gtk/hexchat.rc b/src/fe-gtk/hexchat.rc.tt
index 789aa26e..87507340 100644
--- a/src/fe-gtk/hexchat.rc
+++ b/src/fe-gtk/hexchat.rc.tt
@@ -1,6 +1,7 @@
-#include <winver.h>

+<#@ include file="..\..\version.include.tt" #>#include <winver.h>

 #include "../../config-win32.h"

-#include "../../resource.h"

+

+#define COMMA_VERSION <#= string.Join(",", versionParts) #>,0

 

 XC_ICON ICON "../../data/icons/hexchat.ico"