Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: pylib/gyp/generator/ninja.py
- ===================================================================
- --- pylib/gyp/generator/ninja.py (revision 1491)
- +++ pylib/gyp/generator/ninja.py (working copy)
- @@ -945,6 +945,7 @@
- if self.xcode_settings:
- variables.append(('libtool_flags',
- self.xcode_settings.GetLibtoolflags(config_name)))
- +
- self.ninja.build(self.target.binary, 'alink', link_deps,
- order_only=compile_deps, variables=variables)
- else:
- @@ -1211,6 +1212,7 @@
- global generator_additional_non_configuration_keys
- global generator_additional_path_sections
- flavor = gyp.common.GetFlavor(params)
- + default_variables.setdefault('HOST_OS', gyp.common.GetHostOS())
- if flavor == 'mac':
- default_variables.setdefault('OS', 'mac')
- default_variables.setdefault('SHARED_LIB_SUFFIX', '.dylib')
- @@ -1284,6 +1286,7 @@
- config_name):
- options = params['options']
- flavor = gyp.common.GetFlavor(params)
- + host_os = gyp.common.GetHostOS()
- generator_flags = params.get('generator_flags', {})
- # build_dir: relative path from source root to our output files.
- @@ -1298,7 +1301,7 @@
- width=120)
- # Put build-time support tools in out/{config_name}.
- - gyp.common.CopyTool(flavor, toplevel_build)
- + gyp.common.CopyTool(host_os, toplevel_build)
- # Grab make settings for CC/CXX.
- # The rules are
- @@ -1345,7 +1348,7 @@
- ld_host = os.path.join(build_to_root, value)
- flock = 'flock'
- - if flavor == 'mac':
- + if host_os == 'mac':
- flock = './gyp-mac-tool flock'
- cc = GetEnvironFallback(['CC_target', 'CC'], cc)
- master_ninja.variable('cc', cc)
- @@ -1388,7 +1391,7 @@
- else:
- master_ninja.variable('ld_host', flock + ' linker.lock ' + ld_host)
- - if flavor == 'mac':
- + if host_os == 'mac':
- master_ninja.variable('mac_tool', os.path.join('.', 'gyp-mac-tool'))
- master_ninja.newline()
- @@ -1396,13 +1399,13 @@
- master_ninja.rule(
- 'cc',
- description='CC $out',
- - command=('$cc -MMD -MF $out.d $defines $includes $cflags $cflags_c '
- + command=('$cc_host -MMD -MF $out.d $defines $includes $cflags $cflags_c '
- '$cflags_pch_c -c $in -o $out'),
- depfile='$out.d')
- master_ninja.rule(
- 'cxx',
- description='CXX $out',
- - command=('$cxx -MMD -MF $out.d $defines $includes $cflags $cflags_cc '
- + command=('$cxx_host -MMD -MF $out.d $defines $includes $cflags $cflags_cc '
- '$cflags_pch_cc -c $in -o $out'),
- depfile='$out.d')
- else:
- @@ -1414,12 +1417,12 @@
- # when compiling PCH.
- cc_template = ('ninja-deplist-helper -r . -q -f cl -o $out.dl -e $arch '
- '--command '
- - '$cc /nologo /showIncludes /FC '
- + '$cc_host /nologo /showIncludes /FC '
- '@$out.rsp '
- '$cflags_pch_c /c $in %(outspec)s /Fd$pdbname ')
- cxx_template = ('ninja-deplist-helper -r . -q -f cl -o $out.dl -e $arch '
- '--command '
- - '$cxx /nologo /showIncludes /FC '
- + '$cxx_host /nologo /showIncludes /FC '
- '@$out.rsp '
- '$cflags_pch_cc /c $in %(outspec)s $pchobj /Fd$pdbname ')
- master_ninja.rule(
- @@ -1470,7 +1473,7 @@
- '$arch $asm $defines $includes /c /Fo $out $in' %
- sys.executable))
- - if flavor != 'mac' and flavor != 'win':
- + if host_os != 'mac' and host_os != 'win':
- master_ninja.rule(
- 'alink',
- description='AR $out',
- @@ -1511,7 +1514,7 @@
- description='LINK $out',
- command=('$ld $ldflags -o $out -Wl,-rpath=\$$ORIGIN/lib '
- '-Wl,--start-group $in $solibs -Wl,--end-group $libs'))
- - elif flavor == 'win':
- + elif host_os == 'win':
- master_ninja.rule(
- 'alink',
- description='LIB $out',
- @@ -1547,27 +1550,14 @@
- (sys.executable, sys.executable)),
- rspfile='$out.rsp',
- rspfile_content='$in_newline $libs $ldflags')
- - else:
- + else: # host_os == 'mac'
- master_ninja.rule(
- - 'objc',
- - description='OBJC $out',
- - command=('$cc -MMD -MF $out.d $defines $includes $cflags $cflags_objc '
- - '$cflags_pch_objc -c $in -o $out'),
- - depfile='$out.d')
- - master_ninja.rule(
- - 'objcxx',
- - description='OBJCXX $out',
- - command=('$cxx -MMD -MF $out.d $defines $includes $cflags $cflags_objcc '
- - '$cflags_pch_objcc -c $in -o $out'),
- - depfile='$out.d')
- - master_ninja.rule(
- 'alink',
- description='LIBTOOL-STATIC $out, POSTBUILDS',
- command='rm -f $out && '
- './gyp-mac-tool filter-libtool libtool $libtool_flags '
- '-static -o $out $in'
- '$postbuilds')
- -
- # Record the public interface of $lib in $lib.TOC. See the corresponding
- # comment in the posix section above for details.
- mtime_preserving_solink_base = (
- @@ -1608,20 +1598,72 @@
- description='LINK $out, POSTBUILDS',
- command=('$ld $ldflags -o $out '
- '$in $solibs $libs$postbuilds'))
- +
- + if flavor == 'mac':
- master_ninja.rule(
- + 'objc',
- + description='OBJC $out',
- + command=('$cc -MMD -MF $out.d $defines $includes $cflags $cflags_objc '
- + '$cflags_pch_objc -c $in -o $out'),
- + depfile='$out.d')
- + master_ninja.rule(
- + 'objcxx',
- + description='OBJCXX $out',
- + command=('$cxx -MMD -MF $out.d $defines $includes $cflags $cflags_objcc '
- + '$cflags_pch_objcc -c $in -o $out'),
- + depfile='$out.d')
- + master_ninja.rule(
- 'infoplist',
- description='INFOPLIST $out',
- command=('$cc -E -P -Wno-trigraphs -x c $defines $in -o $out && '
- 'plutil -convert xml1 $out $out'))
- master_ninja.rule(
- - 'mac_tool',
- - description='MACTOOL $mactool_cmd $in',
- - command='$env $mac_tool $mactool_cmd $in $out')
- - master_ninja.rule(
- 'package_framework',
- description='PACKAGE FRAMEWORK $out, POSTBUILDS',
- command='$mac_tool package-framework $out $version$postbuilds '
- '&& touch $out')
- + elif flavor == 'android':
- + master_ninja.rule(
- + 'alink_target',
- + description='AR $out',
- + command='rm -f $out && $ar rcsT $out $in')
- +
- + # This allows targets that only need to depend on $lib's API to declare an
- + # order-only dependency on $lib.TOC and avoid relinking such downstream
- + # dependencies when $lib changes only in non-public ways.
- + # The resulting string leaves an uninterpolated %{suffix} which
- + # is used in the final substitution below.
- + mtime_preserving_solink_base = (
- + 'if [ ! -e $lib -o ! -e ${lib}.TOC ]; then '
- + '%(solink_target)s && %(extract_toc)s > ${lib}.TOC; else '
- + '%(solink_target)s && %(extract_toc)s > ${lib}.tmp && '
- + 'if ! cmp -s ${lib}.tmp ${lib}.TOC; then mv ${lib}.tmp ${lib}.TOC ; '
- + 'fi; fi'
- + % { 'solink_target':
- + '$ld_target -shared $ldflags -o $lib -Wl,-soname=$soname %(suffix)s',
- build.ninja
- rule solink_module
- command = if [ ! -e $lib -o ! -e ${lib}.TOC ] || otool -l $lib | grep -q LC_REEXPORT_DYLIB ; then $ld -shared $
- $ldflags -o $lib $in $solibs $libs$postbuilds && { otool -l $lib | grep LC_ID_DYLIB -A 5; nm -gP $lib | cut $
- -f1-2 -d' ' | grep -v U$$; true; } > ${lib}.TOC; else $ld -shared $ldflags -o $lib $in $solibs $libs$postbuilds $
- && { otool -l $lib | grep LC_ID_DYLIB -A 5; nm -gP $lib | cut -f1-2 -d' ' | grep -v U$$; true; } > ${lib}.tmp $
- && if ! cmp -s ${lib}.tmp ${lib}.TOC; then mv ${lib}.tmp ${lib}.TOC ; fi; fi
- description = SOLINK(module) $lib, POSTBUILDS
- restat = 1
- rule link
- command = $ld $ldflags -o $out $in $solibs $libs$postbuilds
- description = LINK $out, POSTBUILDS
- rule alink_target
- command = rm -f $out && $ar rcsT $out $in
- description = AR $out
- rule solink_target
- command = if [ ! -e $lib -o ! -e ${lib}.TOC ]; then $ld_target -shared $ldflags -o $lib -Wl,-soname=$soname $
- -Wl,--whole-archive $in $solibs -Wl,--no-whole-archive $libs && { readelf -d ${lib} | grep SONAME ; nm -gD -f p $
- ${lib} | cut -f1-2 -d' '; } > ${lib}.TOC; else $ld_target -shared $ldflags -o $lib -Wl,-soname=$soname $
- -Wl,--whole-archive $in $solibs -Wl,--no-whole-archive $libs && { readelf -d ${lib} | grep SONAME ; nm -gD -f p $
- ${lib} | cut -f1-2 -d' '; } > ${lib}.tmp && if ! cmp -s ${lib}.tmp ${lib}.TOC; then mv ${lib}.tmp ${lib}.TOC ; $
- fi; fi
- description = SOLINK $lib
- restat = 1
- rule solink_module_target
- command = if [ ! -e $lib -o ! -e ${lib}.TOC ]; then $ld_target -shared $ldflags -o $lib -Wl,-soname=$soname $
- -Wl,--start-group $in $solibs -Wl,--end-group $libs && { readelf -d ${lib} | grep SONAME ; nm -gD -f p ${lib} | $
- cut -f1-2 -d' '; } > ${lib}.TOC; else $ld_target -shared $ldflags -o $lib -Wl,-soname=$soname -Wl,--start-group $
- ~/projects/webrtc-jingle-client/trunk/out/Debug/build.ninja CWD: /Users/luke/projects/webrtc-jingle-client/trunk/out/Debug Line: 37
- + 'extract_toc':
- + ('{ readelf -d ${lib} | grep SONAME ; '
- + 'nm -gD -f p ${lib} | cut -f1-2 -d\' \'; }')})
- +
- + master_ninja.rule(
- + 'solink_target',
- + description='SOLINK $lib',
- + restat=True,
- + command=(mtime_preserving_solink_base % {
- + 'suffix': '-Wl,--whole-archive $in $solibs -Wl,--no-whole-archive '
- + '$libs'}))
- + master_ninja.rule(
- + 'solink_module_target',
- + description='SOLINK(module) $lib',
- + restat=True,
- + command=(mtime_preserving_solink_base % {
- + 'suffix': '-Wl,--start-group $in $solibs -Wl,--end-group $libs'}))
- + master_ninja.rule(
- + 'link_target',
- + description='LINK $out',
- + command=('$ld $ldflags -o $out -Wl,-rpath=\$$ORIGIN/lib '
- + '-Wl,--start-group $in $solibs -Wl,--end-group $libs'))
- +
- if flavor == 'win':
- master_ninja.rule(
- 'stamp',
Advertisement
Add Comment
Please, Sign In to add comment