Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1311)

Issue 24792003: homogenize msvs and ninja library_dir and libraries settings for Windows (Closed)

Created:
7 years, 2 months ago by ericvw
Modified:
7 years, 2 months ago
Reviewers:
Nico, scottmg
CC:
gyp-developer_googlegroups.com
Base URL:
https://chromium.googlesource.com/external/gyp.git@master
Visibility:
Public.

Description

homogenize msvs and ninja library_dir and libraries settings for Windows Since the introduction of r1657, which added library_dirs support for ninja, the test case did not exercise the win flavor properly, which should translate -lfoo to foo.lib. Thus, the generation between msvs and ninja differed resulting in ninja being unable to link libraries that used the '-lfoo' form of specifiying libraries. It turns out that a name without an extension gets translated as a .obj when using the msvs compiler. This patch modifies 3 things: 1) In msvs_emulation.py, translate -lfoo to foo.lib and only add the .lib suffix if it did not already exist (similar to _GetLibraries in msvs.py). 2) Update the library_dirs test case to remove the usage of: 'libraries': [ '<(STATIC_LIB_PREFIX)mylib<(STATIC_LIB_SUFFIX)', ], so that all test cases test against '-lmylib' to catch any translation errors. Add an additional test case to ensure that '-lmylib.lib' is translated to 'mylib.lib' for the win flavor of ninja. 3) While not critical, change the translation of library_dirs for the win flavor of ninja to use /LIBPATH instead of -LIBPATH and moved the QutoeShellArgument() call around the path, not the entire setting to keep it consistent with the msvs generator. R=scottmg@chromium.org Committed: https://code.google.com/p/gyp/source/detail?r=1743

Patch Set 1 #

Total comments: 1

Patch Set 2 : only add .lib extension if it does not already exist #

Total comments: 1

Patch Set 3 : add -lmylib.lib test case for win32/cygwin #

Total comments: 4

Patch Set 4 : style changes and updating test case #

Patch Set 5 : reland r1743 with fixed test case #

Unified diffs Side-by-side diffs Delta from patch set Stats (+28 lines, -26 lines) Patch
M pylib/gyp/generator/ninja.py View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M pylib/gyp/msvs_emulation.py View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M test/library_dirs/gyptest-library-dirs.py View 1 2 3 2 chunks +17 lines, -0 lines 0 comments Download
M test/library_dirs/subdir/test.gyp View 1 chunk +3 lines, -11 lines 0 comments Download
A + test/library_dirs/subdir/test-win.gyp View 1 2 3 2 chunks +4 lines, -12 lines 0 comments Download

Messages

Total messages: 19 (0 generated)
ericvw
initial patch uploaded
7 years, 2 months ago (2013-09-26 19:41:12 UTC) #1
scottmg
https://codereview.chromium.org/24792003/diff/1/pylib/gyp/msvs_emulation.py File pylib/gyp/msvs_emulation.py (right): https://codereview.chromium.org/24792003/diff/1/pylib/gyp/msvs_emulation.py#newcode205 pylib/gyp/msvs_emulation.py:205: return [lib[2:] + '.lib' if lib.startswith('-l') else lib Hmm, ...
7 years, 2 months ago (2013-09-26 19:50:04 UTC) #2
ericvw
OK. I will change it to check if the .lib extension is already there similar ...
7 years, 2 months ago (2013-09-26 19:57:13 UTC) #3
ericvw
Uploaded new patch based on feedback. The .lib extension is now conditionally added if it ...
7 years, 2 months ago (2013-09-26 20:10:29 UTC) #4
scottmg
https://codereview.chromium.org/24792003/diff/6001/test/library_dirs/subdir/test.gyp File test/library_dirs/subdir/test.gyp (right): https://codereview.chromium.org/24792003/diff/6001/test/library_dirs/subdir/test.gyp#newcode55 test/library_dirs/subdir/test.gyp:55: '-lmylib', since we're defacto supporting -lmylib.lib, please add a ...
7 years, 2 months ago (2013-09-26 20:20:47 UTC) #5
ericvw
> https://codereview.chromium.org/24792003/diff/6001/test/library_dirs/subdir/test.gyp#newcode55 > test/library_dirs/subdir/test.gyp:55: '-lmylib', > since we're defacto supporting -lmylib.lib, please add a test ...
7 years, 2 months ago (2013-09-26 22:39:31 UTC) #6
scottmg
On 2013/09/26 22:39:31, ericvw wrote: > > > https://codereview.chromium.org/24792003/diff/6001/test/library_dirs/subdir/test.gyp#newcode55 > > test/library_dirs/subdir/test.gyp:55: '-lmylib', > > ...
7 years, 2 months ago (2013-09-26 23:06:05 UTC) #7
ericvw
Uploaded patch set that tests -lmylib.lib as requested. Currently this adds conditionally execution in the ...
7 years, 2 months ago (2013-09-27 16:30:46 UTC) #8
scottmg
https://codereview.chromium.org/24792003/diff/14001/pylib/gyp/msvs_emulation.py File pylib/gyp/msvs_emulation.py (right): https://codereview.chromium.org/24792003/diff/14001/pylib/gyp/msvs_emulation.py#newcode205 pylib/gyp/msvs_emulation.py:205: libs = [lib[2:] if lib.startswith('-l') else lib for lib ...
7 years, 2 months ago (2013-09-27 20:38:47 UTC) #9
ericvw
uploaded new patch set based on most recent feedback. https://codereview.chromium.org/24792003/diff/14001/test/library_dirs/subdir/test-win.gyp File test/library_dirs/subdir/test-win.gyp (right): https://codereview.chromium.org/24792003/diff/14001/test/library_dirs/subdir/test-win.gyp#newcode60 test/library_dirs/subdir/test-win.gyp:60: ...
7 years, 2 months ago (2013-09-27 21:48:01 UTC) #10
scottmg
Thanks! LGTM.
7 years, 2 months ago (2013-09-27 21:51:13 UTC) #11
ericvw
On 2013/09/27 21:51:13, scottmg wrote: > Thanks! LGTM. Description updated to reflect current changes.
7 years, 2 months ago (2013-09-27 23:39:18 UTC) #12
scottmg
Committed patchset #4 manually as r1743.
7 years, 2 months ago (2013-09-28 03:21:45 UTC) #13
ericvw
On 2013/09/28 03:21:45, scottmg wrote: > Committed patchset #4 manually as r1743. Oops. I forgot ...
7 years, 2 months ago (2013-09-28 13:14:57 UTC) #14
Nico
This apparently broke xcode tests on mac (look for '-lmylib'): Build settings from command line: ...
7 years, 2 months ago (2013-10-01 19:17:48 UTC) #15
ericvw
On 2013/10/01 19:17:48, Nico wrote: > This apparently broke xcode tests on mac (look for ...
7 years, 2 months ago (2013-10-01 19:33:55 UTC) #16
Shezan Baig (Bloomberg)
On 2013/10/01 19:17:48, Nico wrote: > Using -lmylib on non-linux isn't correct. Can you fix ...
7 years, 2 months ago (2013-10-01 19:37:27 UTC) #17
Nico
On 2013/10/01 19:37:27, Shezan Baig (Bloomberg) wrote: > On 2013/10/01 19:17:48, Nico wrote: > > ...
7 years, 2 months ago (2013-10-01 19:45:59 UTC) #18
ericvw
7 years, 2 months ago (2013-10-04 20:49:36 UTC) #19
Message was sent while issue was closed.
Sorry, please ignore patch set 5.  I attempted to upload this to a new CL and
failed.

Powered by Google App Engine
This is Rietveld 408576698