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

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

Issue 376603002: This CL adds support for extension in GYP. (Closed) Base URL: https://chromium.googlesource.com/external/gyp.git@master
Patch Set: comment corrections Created 6 years, 5 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/generator/xcode.py » ('j') | pylib/gyp/input.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pylib/gyp/generator/ninja.py
diff --git a/pylib/gyp/generator/ninja.py b/pylib/gyp/generator/ninja.py
index f31068a9bf44a89b1c83e61afccc01d284e06fc8..6200ae5238cc92d9385581c79c83e37525564c5d 100644
--- a/pylib/gyp/generator/ninja.py
+++ b/pylib/gyp/generator/ninja.py
@@ -25,6 +25,8 @@ import gyp.ninja_syntax as ninja_syntax
generator_default_variables = {
'EXECUTABLE_PREFIX': '',
'EXECUTABLE_SUFFIX': '',
+ 'EXTENSION_PREFIX': '',
+ 'EXTENSION_SUFFIX': '',
'STATIC_LIB_PREFIX': 'lib',
'STATIC_LIB_SUFFIX': '.a',
'SHARED_LIB_PREFIX': 'lib',
@@ -997,6 +999,7 @@ class NinjaWriter:
"""Write out a link step. Fills out target.binary. """
command = {
'executable': 'link',
+ 'extension': 'link',
'loadable_module': 'solink_module',
'shared_library': 'solink',
}[spec['type']]
@@ -1046,7 +1049,8 @@ class NinjaWriter:
if arch is None and not self.is_mac_bundle:
self.AppendPostbuildVariable(extra_bindings, spec, output, output)
- is_executable = spec['type'] == 'executable'
+ is_executable = (spec['type'] == 'executable' or
+ spec['type'] == 'extension')
pkl (ping after 24h if needed) 2014/07/09 08:07:50 how about this: spec['type'] in ('executable', '
olivierrobin 2014/07/09 12:46:27 Done.
# The ldflags config key is not used on mac or win. On those platforms
# linker flags are set via xcode_settings and msvs_settings, respectively.
env_ldflags = os.environ.get('LDFLAGS', '').split()
@@ -1340,6 +1344,7 @@ class NinjaWriter:
'shared_library': default_variables['SHARED_LIB_PREFIX'],
'static_library': default_variables['STATIC_LIB_PREFIX'],
'executable': default_variables['EXECUTABLE_PREFIX'],
+ 'extension': default_variables['EXTENSION_PREFIX'],
}
prefix = spec.get('product_prefix', DEFAULT_PREFIX.get(type, ''))
@@ -1350,6 +1355,7 @@ class NinjaWriter:
'shared_library': default_variables['SHARED_LIB_SUFFIX'],
'static_library': default_variables['STATIC_LIB_SUFFIX'],
'executable': default_variables['EXECUTABLE_SUFFIX'],
+ 'extension': default_variables['EXTENSION_SUFFIX'],
}
extension = spec.get('product_extension')
if extension:
@@ -1368,7 +1374,7 @@ class NinjaWriter:
target = StripPrefix(target, 'lib')
if type in ('static_library', 'loadable_module', 'shared_library',
- 'executable'):
+ 'executable', 'extension'):
return '%s%s%s' % (prefix, target, extension)
elif type == 'none':
return '%s.stamp' % target
@@ -1386,7 +1392,11 @@ class NinjaWriter:
return override
if arch is None and self.flavor == 'mac' and type in (
- 'static_library', 'executable', 'shared_library', 'loadable_module'):
+ 'static_library',
+ 'executable',
+ 'extension',
+ 'shared_library',
+ 'loadable_module'):
filename = self.xcode_settings.GetExecutablePath()
else:
filename = self.ComputeOutputFileName(spec, type)
@@ -1397,7 +1407,7 @@ class NinjaWriter:
# Some products go into the output root, libraries go into shared library
# dir, and everything else goes into the normal place.
- type_in_output_root = ['executable', 'loadable_module']
+ type_in_output_root = ['executable', 'extension', 'loadable_module']
if self.flavor == 'mac' and self.toolset == 'target':
type_in_output_root += ['shared_library', 'static_library']
elif self.flavor == 'win' and self.toolset == 'target':
« no previous file with comments | « no previous file | pylib/gyp/generator/xcode.py » ('j') | pylib/gyp/input.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698