Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allow library entries of the form '-lfoo' on MSVS.

This allows libraries to be specified in way that
works on all platforms.

BUG=

Review URL: https://codereview.chromium.org/10948014

git-svn-id: http://gyp.googlecode.com/svn/trunk@1505 78cadc50-ecff-11dd-a971-7dbc132099af
  • Loading branch information...
commit 9f65ec7afe80b1a5fc563f8490eee2babbba41d0 1 parent ab7aa2d
sbc@chromium.org authored
Showing with 6 additions and 2 deletions.
  1. +2 −0  pylib/gyp/generator/msvs.py
  2. +4 −2 pylib/gyp/generator/msvs_test.py
2  pylib/gyp/generator/msvs.py
View
@@ -1124,6 +1124,8 @@ def _GetLibraries(spec):
unique_libraries_list = []
for entry in reversed(libraries):
library = re.sub('^\-l', '', entry)
+ if not os.path.splitext(library)[1]:
+ library += '.lib'
if library not in found:
found.add(library)
unique_libraries_list.append(library)
6 pylib/gyp/generator/msvs_test.py
View
@@ -1,6 +1,5 @@
#!/usr/bin/env python
-
-# Copyright (c) 2011 Google Inc. All rights reserved.
+# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -27,6 +26,9 @@ def test_GetLibraries(self):
msvs._GetLibraries({'other':'foo', 'libraries': ['a.lib']}),
['a.lib'])
self.assertEqual(
+ msvs._GetLibraries({'libraries': ['-la']}),
+ ['a.lib'])
+ self.assertEqual(
msvs._GetLibraries({'libraries': ['a.lib', 'b.lib', 'c.lib', '-lb.lib',
'-lb.lib', 'd.lib', 'a.lib']}),
['c.lib', 'b.lib', 'd.lib', 'a.lib'])
Please sign in to comment.
Something went wrong with that request. Please try again.