build,win: fix node.exe resource version
authorJoão Reis <reis@janeasystems.com>
Wed, 23 Sep 2015 12:33:09 +0000 (13:33 +0100)
committerRod Vagg <rod@vagg.org>
Fri, 2 Oct 2015 03:39:25 +0000 (13:39 +1000)
When MSBuild invokes rc.exe, it passes NODE_TAG unstringified, but
passes it correctly to cl.exe. Hence, this workaround was made to
apply only to the resource file.

Fixes: https://github.com/nodejs/node/issues/2963
PR-URL: https://github.com/nodejs/node/pull/3053
Reviewed-By: Alexis Campailla <orangemocha@nodejs.org>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
src/node_version.h
src/res/node.rc

index 7176779..803314a 100644 (file)
 # else
 #  define NODE_TAG "-pre"
 # endif
+#else
+// NODE_TAG is passed without quotes when rc.exe is run from msbuild
+# define NODE_EXE_VERSION NODE_STRINGIFY(NODE_MAJOR_VERSION) "." \
+                          NODE_STRINGIFY(NODE_MINOR_VERSION) "." \
+                          NODE_STRINGIFY(NODE_PATCH_VERSION)     \
+                          NODE_STRINGIFY(NODE_TAG)
 #endif
 
 # define NODE_VERSION_STRING  NODE_STRINGIFY(NODE_MAJOR_VERSION) "." \
                               NODE_STRINGIFY(NODE_MINOR_VERSION) "." \
                               NODE_STRINGIFY(NODE_PATCH_VERSION)     \
                               NODE_TAG
+#ifndef NODE_EXE_VERSION
+# define NODE_EXE_VERSION NODE_VERSION_STRING
+#endif
 
 #define NODE_VERSION "v" NODE_VERSION_STRING
 
index 587843d..b2f7f30 100644 (file)
@@ -32,8 +32,8 @@ BEGIN
             VALUE "CompanyName", "Node.js"
             VALUE "ProductName", "Node.js"
             VALUE "FileDescription", "Node.js: Server-side JavaScript"
-            VALUE "FileVersion", "NODE_VERSION_STRING"
-            VALUE "ProductVersion", "NODE_VERSION_STRING"
+            VALUE "FileVersion", NODE_EXE_VERSION
+            VALUE "ProductVersion", NODE_EXE_VERSION
             VALUE "OriginalFilename", "node.exe"
             VALUE "InternalName", "node"
             VALUE "LegalCopyright", "Copyright Node.js contributors. MIT license."