diff mbox

[ovs-dev,v2] datapath-windows: Set Version correctly for OVSExt

Message ID 1494964613-2664-1-git-send-email-rams@vmware.com
State Accepted
Headers show

Commit Message

Shashank Ram May 16, 2017, 7:56 p.m. UTC
- Previously, the 'Version' property passed to MSBuild
  was not being passed to the RcComplile section. To
  use the value of 'Version' property in the rc file,
  it needs to be passed.

- Adds a macro to convert the Version to a string literal.
  Previously, the Version was simply being converted
  to a literal text 'Version' instead of the the version
  number passed using the 'Version' property to MSBuild.

Signed-off-by: Shashank Ram <rams@vmware.com>
---
 datapath-windows/ovsext/ovsext.rc      |  5 +++--
 datapath-windows/ovsext/ovsext.vcxproj | 14 +++++++-------
 2 files changed, 10 insertions(+), 9 deletions(-)

--
2.6.2

Comments

Alin Serdean May 17, 2017, 12:42 p.m. UTC | #1
Just one small nit if you want to fix it (but not necessarily needed): no newline at the end of file.
This is because editing the file via the GUI strips down eol.

Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>

> -----Original Message-----
> From: ovs-dev-bounces@openvswitch.org [mailto:ovs-dev-
> bounces@openvswitch.org] On Behalf Of Shashank Ram
> Sent: Tuesday, May 16, 2017 10:57 PM
> To: dev@openvswitch.org
> Subject: [ovs-dev] [PATCH v2] datapath-windows: Set Version correctly for
> OVSExt
> 
> - Previously, the 'Version' property passed to MSBuild
>   was not being passed to the RcComplile section. To
>   use the value of 'Version' property in the rc file,
>   it needs to be passed.
> 
> - Adds a macro to convert the Version to a string literal.
>   Previously, the Version was simply being converted
>   to a literal text 'Version' instead of the the version
>   number passed using the 'Version' property to MSBuild.
> 
> Signed-off-by: Shashank Ram <rams@vmware.com>
> ---
>    <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> -</Project>
> \ No newline at end of file
> +</Project>
> --
> 2.6.2
> 
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
diff mbox

Patch

diff --git a/datapath-windows/ovsext/ovsext.rc b/datapath-windows/ovsext/ovsext.rc
index a7cf0a7..e6334c2 100644
--- a/datapath-windows/ovsext/ovsext.rc
+++ b/datapath-windows/ovsext/ovsext.rc
@@ -9,6 +9,7 @@  LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
 #pragma code_page(1252)

 #define STR(x)                          #x
+#define VER_TO_STR(v)                   STR(v)
 /////////////////////////////////////////////////////////////////////////////
 //
 // Version
@@ -33,12 +34,12 @@  BEGIN
         BEGIN
             VALUE "CompanyName", "The Linux Foundation (R)"
             VALUE "FileDescription", "Open vSwitch Extension"
-            VALUE "FileVersion", STR(Version)
+            VALUE "FileVersion", VER_TO_STR(VersionWithDots)
             VALUE "InternalName", "OVSExt.SYS"
             VALUE "LegalCopyright", "Licensed under the Apache License, Version 2.0 (the ""License"")"
             VALUE "OriginalFilename", "OVSExt.SYS"
             VALUE "ProductName", "Open vSwitch"
-            VALUE "ProductVersion", STR(Version)
+            VALUE "ProductVersion", VER_TO_STR(VersionWithDots)
         END
     END
     BLOCK "VarFileInfo"
diff --git a/datapath-windows/ovsext/ovsext.vcxproj b/datapath-windows/ovsext/ovsext.vcxproj
index ecfc0b8..5b79c6a 100644
--- a/datapath-windows/ovsext/ovsext.vcxproj
+++ b/datapath-windows/ovsext/ovsext.vcxproj
@@ -295,12 +295,12 @@ 
     <ClCompile Include="Vport.c" />
     <ClCompile Include="Vxlan.c" />
     <ResourceCompile Include="ovsext.rc">
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Win8 Release|x64'">%(PreprocessorDefinitions);NDIS_WDM=1;NDIS630=1;VersionWithCommas=$(Version.Replace('.',','))</PreprocessorDefinitions>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Win8 Debug|x64'">%(PreprocessorDefinitions);NDIS_WDM=1;NDIS630=1;VersionWithCommas=$(Version.Replace('.',','))</PreprocessorDefinitions>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Win8.1 Release|x64'">%(PreprocessorDefinitions);NDIS_WDM=1;NDIS640=1;VersionWithCommas=$(Version.Replace('.',','))</PreprocessorDefinitions>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Win8.1 Debug|x64'">%(PreprocessorDefinitions);NDIS_WDM=1;NDIS640=1;VersionWithCommas=$(Version.Replace('.',','))</PreprocessorDefinitions>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Win10 Release|x64'">%(PreprocessorDefinitions);NDIS_WDM=1;NDIS640=1;VersionWithCommas=$(Version.Replace('.',','))</PreprocessorDefinitions>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Win10 Debug|x64'">%(PreprocessorDefinitions);NDIS_WDM=1;NDIS640=1;VersionWithCommas=$(Version.Replace('.',','))</PreprocessorDefinitions>
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Win8 Release|x64'">%(PreprocessorDefinitions);NDIS_WDM=1;NDIS630=1;VersionWithDots=$(Version);VersionWithCommas=$(Version.Replace('.',','))</PreprocessorDefinitions>
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Win8 Debug|x64'">%(PreprocessorDefinitions);NDIS_WDM=1;NDIS630=1;VersionWithDots=$(Version);VersionWithCommas=$(Version.Replace('.',','))</PreprocessorDefinitions>
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Win8.1 Release|x64'">%(PreprocessorDefinitions);NDIS_WDM=1;NDIS640=1;VersionWithDots=$(Version);VersionWithCommas=$(Version.Replace('.',','))</PreprocessorDefinitions>
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Win8.1 Debug|x64'">%(PreprocessorDefinitions);NDIS_WDM=1;NDIS640=1;VersionWithDots=$(Version);VersionWithCommas=$(Version.Replace('.',','))</PreprocessorDefinitions>
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Win10 Release|x64'">%(PreprocessorDefinitions);NDIS_WDM=1;NDIS640=1;VersionWithDots=$(Version);VersionWithCommas=$(Version.Replace('.',','))</PreprocessorDefinitions>
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Win10 Debug|x64'">%(PreprocessorDefinitions);NDIS_WDM=1;NDIS640=1;VersionWithDots=$(Version);VersionWithCommas=$(Version.Replace('.',','))</PreprocessorDefinitions>
     </ResourceCompile>
   </ItemGroup>
   <ItemGroup>
@@ -313,4 +313,4 @@ 
     <None Exclude="@(None)" Include="*.def;*.bat;*.hpj;*.asmx" />
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-</Project>
\ No newline at end of file
+</Project>