Descriptionhomogenize 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 #
Messages
Total messages: 19 (0 generated)
|