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

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

Issue 9401016: Fix .d for ninja on Windows (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: Created 8 years, 10 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 | « no previous file | pylib/gyp/ninja_syntax.py » ('j') | pylib/gyp/ninja_syntax.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pylib/gyp/generator/ninja.py
===================================================================
--- pylib/gyp/generator/ninja.py (revision 1200)
+++ pylib/gyp/generator/ninja.py (working copy)
@@ -831,20 +831,35 @@
# Compute filename prefix: the product prefix, or a default for
# the product type.
- DEFAULT_PREFIX = {
- 'loadable_module': 'lib',
- 'shared_library': 'lib',
- 'static_library': 'lib',
- }
+ if self.flavor == 'win':
Nico 2012/02/16 19:32:26 This should be !=, or you need to swap the branch
+ DEFAULT_PREFIX = {
+ 'loadable_module': 'lib',
+ 'shared_library': 'lib',
+ 'static_library': 'lib',
+ }
+ else:
+ DEFAULT_PREFIX = {
+ 'loadable_module': '',
+ 'shared_library': '',
+ 'static_library': '',
+ }
prefix = spec.get('product_prefix', DEFAULT_PREFIX.get(type, ''))
# Compute filename extension: the product extension, or a default
# for the product type.
- DEFAULT_EXTENSION = {
- 'static_library': 'a',
- 'loadable_module': 'so',
- 'shared_library': 'so',
- }
+ if self.flavor == 'win':
+ DEFAULT_EXTENSION = {
+ 'static_library': 'lib',
+ 'loadable_module': 'dll',
+ 'shared_library': 'dll',
+ 'executable': 'exe',
+ }
+ else:
+ DEFAULT_EXTENSION = {
+ 'static_library': 'a',
+ 'loadable_module': 'so',
+ 'shared_library': 'so',
+ }
extension = spec.get('product_extension',
DEFAULT_EXTENSION.get(type, ''))
if extension:
@@ -1052,19 +1067,24 @@
'$cflags_pch_cc -c $in -o $out'),
depfile='$out.d')
else:
- # TODO(scottmg): Decide how /showIncludes handling should work in ninja.
+ # TODO(scottmg): Requires deplist branch of ninja for now (for
+ # /showIncludes handling).
master_ninja.rule(
'cc',
description='CC $out',
- command=('$cc /nologo $defines $includes $cflags $cflags_c '
- '$cflags_pch_c /c $in /Fo$out'),
- depfile='$out.d')
+ command=('cmd /c $cc /nologo /showIncludes '
+ '$defines $includes $cflags $cflags_c '
+ '$cflags_pch_c /c $in /Fo$out '
+ '| ninja-deplist-helper -f cl -o $out.dl'),
+ deplist='$out.dl')
master_ninja.rule(
'cxx',
description='CXX $out',
- command=('$cxx /nologo $defines $includes $cflags $cflags_cc '
- '$cflags_pch_cc /c $in /Fo$out'),
- depfile='$out.d')
+ command=('cmd /c $cxx /nologo /showIncludes '
+ '$defines $includes $cflags $cflags_cc '
+ '$cflags_pch_cc /c $in /Fo$out '
+ '| ninja-deplist-helper -f cl -o $out.dl'),
+ deplist='$out.dl')
if flavor != 'mac' and flavor != 'win':
master_ninja.rule(
@@ -1094,15 +1114,15 @@
master_ninja.rule(
'solink',
description='SOLINK $out',
- command=('$ld /nologo /DLL $ldflags /OUT:$out.dll $in $libs'))
+ command=('$ld /nologo /DLL $ldflags /OUT:$out $in $libs'))
master_ninja.rule(
'solink_module',
description='SOLINK(module) $out',
- command=('$ld /nologo /DLL $ldflags /OUT:$out.dll $in $libs'))
+ command=('$ld /nologo /DLL $ldflags /OUT:$out $in $libs'))
master_ninja.rule(
'link',
description='LINK $out',
- command=('$ld /nologo $ldflags /OUT:$out.exe $in $libs'))
+ command=('$ld /nologo $ldflags /OUT:$out $in $libs'))
else:
master_ninja.rule(
'objc',
« no previous file with comments | « no previous file | pylib/gyp/ninja_syntax.py » ('j') | pylib/gyp/ninja_syntax.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698