Fix MSVS build
authorRyan Dahl <ry@tinyclouds.org>
Mon, 8 Aug 2011 19:32:34 +0000 (12:32 -0700)
committerRyan Dahl <ry@tinyclouds.org>
Mon, 8 Aug 2011 19:32:34 +0000 (12:32 -0700)
tools/gyp_node

index 3cc6527..f38aa71 100755 (executable)
@@ -22,9 +22,17 @@ def run_gyp(args):
 
 if __name__ == '__main__':
   args = sys.argv[1:]
-  args.append(os.path.join(os.path.abspath(node_root), 'node.gyp'))
 
-  options_fn = os.path.abspath(os.path.join(node_root, 'options.gypi'))
+  # GYP bug.
+  # On msvs it will crash if it gets an absolute path.
+  # On Mac/make it will crash if it doesn't get an absolute path.
+  if sys.platform == 'win32':
+    args.append(os.path.join(node_root, 'node.gyp'))
+    options_fn = os.path.join(node_root, 'options.gypi')
+  else:
+    args.append(os.path.join(os.path.abspath(node_root), 'node.gyp'))
+    options_fn = os.path.join(os.path.abspath(node_root), 'options.gypi')
+
   if os.path.exists(options_fn):
     args.extend(['-I', options_fn])