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

Unified Diff: pylib/gyp/generator/ninja.py

Issue 10749020: Adds support for the library_dirs key, which appears in the documentation but was never actually im… (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: library_dirs Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pylib/gyp/generator/msvs.py ('k') | pylib/gyp/generator/xcode.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pylib/gyp/generator/ninja.py
===================================================================
--- pylib/gyp/generator/ninja.py (revision 1656)
+++ pylib/gyp/generator/ninja.py (working copy)
@@ -773,6 +773,20 @@
[QuoteShellArgument('-I' + self.GypPathToNinja(i, env), self.flavor)
for i in include_dirs])
+ library_dirs = config.get('library_dirs', [])
+ if self.flavor == 'win':
+ library_dirs = [
+ self.msvs_settings.ConvertVSMacros(library_dir, config_name)
+ for library_dir in library_dirs]
+ self.WriteVariableList('libdirs',
+ [QuoteShellArgument('-LIBPATH:' + self.GypPathToNinja(l),
+ self.flavor)
+ for l in library_dirs])
+ else:
+ self.WriteVariableList('libdirs',
+ [QuoteShellArgument('-L' + self.GypPathToNinja(l), self.flavor)
+ for l in library_dirs])
+
pch_commands = precompiled_header.GetPchBuildCommands()
if self.flavor == 'mac':
self.WriteVariableList('cflags_pch_c',
@@ -1427,12 +1441,12 @@
master_ninja.rule('solink' + rule_name_suffix,
description=dlldesc, command=dllcmd,
rspfile='$dll.rsp',
- rspfile_content='$libs $in_newline $ldflags',
+ rspfile_content='$libdirs $libs $in_newline $ldflags',
restat=True)
master_ninja.rule('solink_module' + rule_name_suffix,
description=dlldesc, command=dllcmd,
rspfile='$dll.rsp',
- rspfile_content='$libs $in_newline $ldflags',
+ rspfile_content='$libdirs $libs $in_newline $ldflags',
restat=True)
# Note that ldflags goes at the end so that it has the option of
# overriding default settings earlier in the command line.
@@ -1444,7 +1458,7 @@
description='LINK%s $out' % rule_name_suffix.upper(),
command=exe_cmd,
rspfile='$out.rsp',
- rspfile_content='$in_newline $libs $ldflags')
+ rspfile_content='$in_newline $libdirs $libs $ldflags')
def GenerateOutputForConfig(target_list, target_dicts, data, params,
@@ -1689,20 +1703,21 @@
restat=True,
command=(mtime_preserving_solink_base % {
'suffix': '-Wl,--whole-archive $in $solibs -Wl,--no-whole-archive '
- '$libs'}),
+ '$libdirs $libs'}),
pool='link_pool')
master_ninja.rule(
'solink_module',
description='SOLINK(module) $lib',
restat=True,
command=(mtime_preserving_solink_base % {
- 'suffix': '-Wl,--start-group $in $solibs -Wl,--end-group $libs'}),
+ 'suffix': '-Wl,--start-group $in $solibs -Wl,--end-group '
+ '$libdirs $libs'}),
Nico 2013/07/02 01:20:15 Is it possible to just add these flags to the "lib
pool='link_pool')
master_ninja.rule(
'link',
description='LINK $out',
command=('$ld $ldflags -o $out '
- '-Wl,--start-group $in $solibs -Wl,--end-group $libs'),
+ '-Wl,--start-group $in $solibs -Wl,--end-group $libdirs $libs'),
pool='link_pool')
elif flavor == 'win':
master_ninja.rule(
@@ -1769,21 +1784,21 @@
description='SOLINK $lib, POSTBUILDS',
restat=True,
command=(mtime_preserving_solink_base % {
- 'suffix': '$in $solibs $libs$postbuilds'}),
+ 'suffix': '$in $solibs $libdirs $libs$postbuilds'}),
pool='link_pool')
master_ninja.rule(
'solink_module',
description='SOLINK(module) $lib, POSTBUILDS',
restat=True,
command=(mtime_preserving_solink_base % {
- 'suffix': '$in $solibs $libs$postbuilds'}),
+ 'suffix': '$in $solibs $libdirs $libs$postbuilds'}),
pool='link_pool')
master_ninja.rule(
'link',
description='LINK $out, POSTBUILDS',
command=('$ld $ldflags -o $out '
- '$in $solibs $libs$postbuilds'),
+ '$in $solibs $libdirs $libs$postbuilds'),
pool='link_pool')
master_ninja.rule(
'infoplist',
« no previous file with comments | « pylib/gyp/generator/msvs.py ('k') | pylib/gyp/generator/xcode.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698