external/gyp.git
6 weeks agoDropping svn contents, migrated to git, leaving behind README. master
bradnelson@google.com [Mon, 2 Mar 2015 18:17:39 +0000 (18:17 +0000)]
Dropping svn contents, migrated to git, leaving behind README.

Dropping svn contents to avoid confusion on the source of truth.
This repo now lives in git.
Leaving behind a README pointed at the new location.

BUG=None
TEST=None
TBR=mark@chromium.org

git-svn-id: http://gyp.googlecode.com/svn/trunk@2038 78cadc50-ecff-11dd-a971-7dbc132099af

7 weeks agoFixed Gyp Xcode generator for libraries with identical names.
mark@chromium.org [Fri, 27 Feb 2015 21:44:58 +0000 (21:44 +0000)]
Fixed Gyp Xcode generator for libraries with identical names.
(previously landed at r2011 and backed out at r2023, now fixed)

The Xcode generator produces the same hash for library target products
that have identical names and are defined in .gyp files with identical
names that have different source tree roots. The fix consists of setting
the (already defined) 'projectRoot' property on the PBXProject object
and adding it to the hashables of this class.

The original CL falsely added the inherited project path to the
hashables of each child target even if the path wasn't unique. Not only
was this undesired behavior and essentially a bug, but it also created
an issue for very large projects like bling. The time it took to
generate the project files went up from ~2min to over 20min. See
https://code.google.com/p/chromium/issues/detail?id=447801 for more
info.

This CL fixes this behavior.

See also https://codereview.chromium.org/748793002

Patch by Johannes Sartisohn <jsartisohn@google.com>

BUG=447801

Review URL: https://codereview.chromium.org/851103007/

git-svn-id: http://gyp.googlecode.com/svn/trunk@2037 78cadc50-ecff-11dd-a971-7dbc132099af

7 weeks agoAdds the ability for 'copies' in Xcode project files to specify the
mark@chromium.org [Thu, 26 Feb 2015 23:28:10 +0000 (23:28 +0000)]
Adds the ability for 'copies' in Xcode project files to specify the
'Code Sign on Copy' option.

Patch by Matt Ryavec <mattryavec@google.com>

Review URL: https://codereview.chromium.org/956203005/

git-svn-id: http://gyp.googlecode.com/svn/trunk@2036 78cadc50-ecff-11dd-a971-7dbc132099af

8 weeks agoninja/posix: Introduce support for arflags variable.
thakis@chromium.org [Wed, 18 Feb 2015 20:47:55 +0000 (20:47 +0000)]
ninja/posix: Introduce support for arflags variable.

This can be used to pass a --plugin flag to ar.

BUG=chromium:453195
R=thakis@chromium.org

git-svn-id: http://gyp.googlecode.com/svn/trunk@2034 78cadc50-ecff-11dd-a971-7dbc132099af

2 months agoMake msvs-ninja work for target-arch=x64
scottmg@chromium.org [Wed, 11 Feb 2015 23:31:34 +0000 (23:31 +0000)]
Make msvs-ninja work for target-arch=x64

This adds _x64 to the OutDir for msvs project files when ninja builds
are enabled for x64.

Patch from danduong@chromium.org.

R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/880813004

git-svn-id: http://gyp.googlecode.com/svn/trunk@2033 78cadc50-ecff-11dd-a971-7dbc132099af

2 months agomsvs: Prefer x64 toolset if we are running on 64-bit
sbaig1@bloomberg.net [Tue, 10 Feb 2015 19:25:04 +0000 (19:25 +0000)]
msvs: Prefer x64 toolset if we are running on 64-bit

The ninja generator also does the equivalent of this.  This is for the pure msvs generator.

BUG=
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/913493002

git-svn-id: http://gyp.googlecode.com/svn/trunk@2032 78cadc50-ecff-11dd-a971-7dbc132099af

2 months agoReland "msvs/ninja win: Fix support for ImageHasSafeExceptionHandlers"
sbaig1@bloomberg.net [Mon, 2 Feb 2015 23:31:40 +0000 (23:31 +0000)]
Reland "msvs/ninja win: Fix support for ImageHasSafeExceptionHandlers"

This commit fixes the x64 issue and adds a test.  The underlying issue was that
the msvs default value for ImageHasSafeExceptionHandlers is None for x64
targets.  In order to add the x64 test, we need to update the ninja generator
to use ml64.exe instead of ml.exe when building x64 targets.

BUG=
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/861273003

git-svn-id: http://gyp.googlecode.com/svn/trunk@2031 78cadc50-ecff-11dd-a971-7dbc132099af

2 months agowin: Add NoImportLibrary flag for ninja generator
scottmg@chromium.org [Fri, 30 Jan 2015 20:24:26 +0000 (20:24 +0000)]
win: Add NoImportLibrary flag for ninja generator

This adds a flag that tells ninja not to expect an import library
to be generated. This is only needed very rarely in the case of
DLLs that have no exported symbols.

There is no corresponding functionality in the msvs generator, so
the test and functionality are ninja generator-only.

R=grt@chromium.org
BUG=gyp:397, chromium:451499

Review URL: https://codereview.chromium.org/890773004

git-svn-id: http://gyp.googlecode.com/svn/trunk@2030 78cadc50-ecff-11dd-a971-7dbc132099af

2 months agomac: Followup to ZERO_AR_DATE, touch the -o archive, rather than expecting only one
scottmg@chromium.org [Thu, 29 Jan 2015 18:22:01 +0000 (18:22 +0000)]
mac: Followup to ZERO_AR_DATE, touch the -o archive, rather than expecting only one

After https://codereview.chromium.org/791993005/.

When multiarch, libtool is run as "... -o foo.a foo.i386.a foo.x86_64.a"
so previously the touch wouldn't happen. Instead, look for the -o, and
touch that archive.

Add ARCHS to test to exercise this.

R=sebmarchand@chromium.org, thakis@chromium.org
BUG=451499

Review URL: https://codereview.chromium.org/879343004

git-svn-id: http://gyp.googlecode.com/svn/trunk@2029 78cadc50-ecff-11dd-a971-7dbc132099af

2 months agowin: 'EnableEnhancedInstructionSet': '5' now enables /arch:AVX2.
thakis@chromium.org [Fri, 23 Jan 2015 18:41:33 +0000 (18:41 +0000)]
win: 'EnableEnhancedInstructionSet': '5' now enables /arch:AVX2.

BUG=chromium:451290
R=bradnelson@google.com

Review URL: https://codereview.chromium.org/872643002

git-svn-id: http://gyp.googlecode.com/svn/trunk@2028 78cadc50-ecff-11dd-a971-7dbc132099af

2 months agoRevert "msvs/ninja win: Fix support for ImageHasSafeExceptionHandlers"
teravest@chromium.org [Wed, 21 Jan 2015 17:45:28 +0000 (17:45 +0000)]
Revert "msvs/ninja win: Fix support for ImageHasSafeExceptionHandlers"

This patch is being reverted because it caused build errors in chromium when
attempting a gyp roll.

Here's an example error:
LINK : fatal error LNK1246: '/SAFESEH' not compatible with 'x64' target
machine; link without '/SAFESEH'

TBR=sbaig1@bloomberg.net

Review URL: https://codereview.chromium.org/864823003

git-svn-id: http://gyp.googlecode.com/svn/trunk@2027 78cadc50-ecff-11dd-a971-7dbc132099af

2 months agomsvs/ninja win: Fix support for ImageHasSafeExceptionHandlers
sbaig1@bloomberg.net [Tue, 20 Jan 2015 21:03:47 +0000 (21:03 +0000)]
msvs/ninja win: Fix support for ImageHasSafeExceptionHandlers

For ninja, we now emulate msvs by passing /SAFESEH:NO
when ImageHasSafeExceptionHandlers is false, and passing
/SAFESEH otherwise.

For msvs, we now translate "MSBuildOnly" properties from
msvs_settings "as-is".  Also, the msvs generator has been
updated so support the MASM tool, so that the
"gyptest-link-safeseh.py" test can be enabled.

BUG=
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/790213007

git-svn-id: http://gyp.googlecode.com/svn/trunk@2026 78cadc50-ecff-11dd-a971-7dbc132099af

2 months agodon't assume bash is installed
thakis@chromium.org [Tue, 20 Jan 2015 05:34:31 +0000 (05:34 +0000)]
don't assume bash is installed

On systems like OpenBSD bash isn't available by default, this removes the hard
coded path.

Review URL: https://codereview.chromium.org/23460007/
Patch from qbit <deftly@gmail.com>!

git-svn-id: http://gyp.googlecode.com/svn/trunk@2025 78cadc50-ecff-11dd-a971-7dbc132099af

3 months agoAdd 'depfile' option to actions.
teravest@chromium.org [Fri, 16 Jan 2015 16:04:39 +0000 (16:04 +0000)]
Add 'depfile' option to actions.

This adds a 'depfile' option to GYP actions, which allows an action to
provide that 'depfile' for use by ninja.

This is necessary for handling dependencies correctly when an action
compiles generated code.

BUG=https://code.google.com/p/chromium/issues/detail?id=440451
R=bradnelson@google.com

Review URL: https://codereview.chromium.org/793153004

git-svn-id: http://gyp.googlecode.com/svn/trunk@2024 78cadc50-ecff-11dd-a971-7dbc132099af

3 months agoRevert 2011 'Fixed Gyp Xcode generator for libraries with identical names.'
thakis@chromium.org [Thu, 15 Jan 2015 18:46:16 +0000 (18:46 +0000)]
Revert 2011 'Fixed Gyp Xcode generator for libraries with identical names.'

This made the xcode generator very slow for larger projects, see
https://code.google.com/p/chromium/issues/detail?id=447801

git-svn-id: http://gyp.googlecode.com/svn/trunk@2023 78cadc50-ecff-11dd-a971-7dbc132099af

3 months agoDon't serialize linking for the make generator by default
jochen@chromium.org [Wed, 14 Jan 2015 10:40:40 +0000 (10:40 +0000)]
Don't serialize linking for the make generator by default

Instead, projects that want this feature should define a LINK_wrapper

BUG=none
R=thakis@chromium.org

Review URL: https://codereview.chromium.org/839233002

git-svn-id: http://gyp.googlecode.com/svn/trunk@2022 78cadc50-ecff-11dd-a971-7dbc132099af

3 months agoAdd support for generating an Eclipse .classpath file (bug fix)
thakis@chromium.org [Wed, 7 Jan 2015 23:20:26 +0000 (23:20 +0000)]
Add support for generating an Eclipse .classpath file (bug fix)

In r2015, support was added for generating a .classpath file in
the Eclipse generator.  However, it contained a bug that would
add an incorrect directory to the classpath in some circumstances,
if the root folder or any of its parents were named 'src' or
'java'.  This is due to the heuristic nature of determining Java
package root locations.

This commit resolves the bug by preventing the heuristic from
using the root location, or traversing to any of its ancestors.

BUG=gyp:472
Review URL: https://codereview.chromium.org/798133002/

Patch from Kevin McCormick <mckev@amazon.com>!

git-svn-id: http://gyp.googlecode.com/svn/trunk@2021 78cadc50-ecff-11dd-a971-7dbc132099af

3 months agoSet ZERO_AR_DATE=1 when running libtool.
sebmarchand@chromium.org [Wed, 7 Jan 2015 16:57:45 +0000 (16:57 +0000)]
Set ZERO_AR_DATE=1 when running libtool.

This is a reland of https://codereview.chromium.org/699083004/.

See https://code.google.com/p/chromium/issues/detail?id=432483 for the reason of this reland.

BUG=chromium:330262
R=maruel@chromium.org, thakis@chromium.org

Review URL: https://codereview.chromium.org/791993005

git-svn-id: http://gyp.googlecode.com/svn/trunk@2020 78cadc50-ecff-11dd-a971-7dbc132099af

3 months agoFix: xcode-ninja should copy the product extension to the wrapper project
sdefresne@chromium.org [Wed, 24 Dec 2014 08:32:16 +0000 (08:32 +0000)]
Fix: xcode-ninja should copy the product extension to the wrapper project

Two targets may differ in just the product extension. To avoid name
clashes in this situation, the xcode-ninja generator needs to copy this
extension when generating targets for the wrapper project.

Patch by Tobias Hahn <tobias.hahn@ableton.com>.

BUG=gyp:450
TEST=./gyptest.py -f xcode-ninja test/mac/gyptest-loadable-module-bundle-product-extension.py
R=justincohen@chromium.org, sdefresne@chromium.org, justincohen

Review URL: https://codereview.chromium.org/516953002

git-svn-id: http://gyp.googlecode.com/svn/trunk@2019 78cadc50-ecff-11dd-a971-7dbc132099af

3 months agoFix: xcode-ninja should generate Xcode workspace into generator_output
sdefresne@chromium.org [Tue, 23 Dec 2014 16:16:52 +0000 (16:16 +0000)]
Fix: xcode-ninja should generate Xcode workspace into generator_output

The test gyptest-top-all guards against this when run using
TestGypXcodeNinja, i.e.

$ ./gyptest.py -f xcode-ninja test/generator-output/gyptest-top-all.py

BUG=gyp:442

TEST=Run
    ./gyptest.py -f xcode-ninja test/generator-output/gyptest-top-all.py

Expected to pass (instead of failing with Permission denied: 'prog1.ninja.xcworkspace')

Patch by Tobias Hahn <tobias.hahn@ableton.com>.

R=justincohen@chromium.org, sdefresne@chromium.org

Review URL: https://codereview.chromium.org/421053005

git-svn-id: http://gyp.googlecode.com/svn/trunk@2018 78cadc50-ecff-11dd-a971-7dbc132099af

3 months agoAdd TestGypXcodeNinja to run tests against the xcode-ninja generator
sdefresne@chromium.org [Tue, 23 Dec 2014 14:14:21 +0000 (14:14 +0000)]
Add TestGypXcodeNinja to run tests against the xcode-ninja generator

Use:

    ./gyptest.py -f xcode-ninja <tests>

BUG=gyp:443
TEST=Run
    ./gyptest.py -f xcode-ninja -a

Expected: No test failures.

Patch by Tobias Hahn <tobias.hahn@ableton.com>.

R=mark@chromium.org, sdefresne@chromium.org, justincohen@chromium.org

Review URL: https://codereview.chromium.org/421453003

git-svn-id: http://gyp.googlecode.com/svn/trunk@2017 78cadc50-ecff-11dd-a971-7dbc132099af

3 months agoFix mixed line endings warning
sdefresne@chromium.org [Tue, 23 Dec 2014 14:11:16 +0000 (14:11 +0000)]
Fix mixed line endings warning

Fixed using "tr -d '\r' < update_pgd.py > update_pgd_fixed.py" and
then renaming the file to update_pgd.py.

  ** Presubmit ERRORS **
  Pylint (436 files) (104.89s) failed
  ************* Module update_pgd
  C: 33, 0: Mixed line endings LF and CRLF (mixed-line-endings)

BUG=None
TBR=mark@chromium.org

Review URL: https://codereview.chromium.org/822893002

git-svn-id: http://gyp.googlecode.com/svn/trunk@2016 78cadc50-ecff-11dd-a971-7dbc132099af

4 months agoAdd support for generating an Eclipse .classpath file
thakis@chromium.org [Fri, 12 Dec 2014 20:01:03 +0000 (20:01 +0000)]
Add support for generating an Eclipse .classpath file

This adds support for generating a .classpath file that can be copied
to an Eclipse project for improved symbol navigation.

BUG=gyp:472
Review URL: https://codereview.chromium.org/774693004/

Patch from Kevin McCormick <mckev@amazon.com>!

git-svn-id: http://gyp.googlecode.com/svn/trunk@2015 78cadc50-ecff-11dd-a971-7dbc132099af

4 months agoAdd support for iOS WatchKit apps in GYP
justincohen@chromium.org [Wed, 10 Dec 2014 20:58:51 +0000 (20:58 +0000)]
Add support for iOS WatchKit apps in GYP

Adds new target types for Apple Watch apps and their corresponding
WatchKit extensions, along with a test and sample application.

Patch by David Patierno <dmpatierno@google.com>

R=justincohen@chromium.org, sdefresne@chromium.org

Review URL: https://codereview.chromium.org/762673002

git-svn-id: http://gyp.googlecode.com/svn/trunk@2014 78cadc50-ecff-11dd-a971-7dbc132099af

4 months agowin: Add support for VS2015
scottmg@chromium.org [Tue, 9 Dec 2014 20:49:44 +0000 (20:49 +0000)]
win: Add support for VS2015

R=sbaig1@bloomberg.net
BUG=chromium:440500

Review URL: https://codereview.chromium.org/784363003

git-svn-id: http://gyp.googlecode.com/svn/trunk@2013 78cadc50-ecff-11dd-a971-7dbc132099af

4 months agoCache data for included files in the multiprocess load codepath
sbaig1@bloomberg.net [Wed, 3 Dec 2014 18:46:05 +0000 (18:46 +0000)]
Cache data for included files in the multiprocess load codepath

When running gyp with --no-parallel, the build file data for included gypi
files is cached in the 'data' dict, so we never load gypi files more than once.

However, when running in parallel mode, the |data| and |aux_data| parameters
passed to CallLoadTargetBuildFile are always empty.  That means gypi files are
reloaded for every single gyp file.

This commit changes CallLoadTargetBuildFile to use a global |per_process_data|
and |per_process_aux_data|, instead of accepting them as parameters.  This
allows each subprocess to get gypi file data from this per-process cache if it
has already encountered the gypi file when loading a previous target build
file.

Another minor change in this commit is to remove aux_data from ParallelState.
The aux_data is only ever used within the scope of LoadTargetBuildFile, so we
don't need to communicate it back to the main process.

BUG=
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/773883002

git-svn-id: http://gyp.googlecode.com/svn/trunk@2012 78cadc50-ecff-11dd-a971-7dbc132099af

4 months agoFixed Gyp Xcode generator for libraries with identical names.
scottmg@chromium.org [Tue, 2 Dec 2014 18:37:55 +0000 (18:37 +0000)]
Fixed Gyp Xcode generator for libraries with identical names.

The Xcode generator produces the same hash for library target products that have
identical names and are defined in .gyp files with identical names that have
different source tree roots. The fix consists of setting the (already defined)
'projectRoot' property on the PBXProject object and adding it to the hashables
of this class.

Patch by Johannes Sartisohn <jsartisohn@google.com>

R=mark@chromium.org

Review URL: https://codereview.chromium.org/748793002

git-svn-id: http://gyp.googlecode.com/svn/trunk@2011 78cadc50-ecff-11dd-a971-7dbc132099af

4 months agoandroid: don't try to handle suppress_wildcard.
torne@chromium.org [Thu, 27 Nov 2014 16:56:53 +0000 (16:56 +0000)]
android: don't try to handle suppress_wildcard.

When deciding whether to include a target in the generated makefiles or
not, don't consider the suppress_wildcard flag as this just means that
any target which depends directly on the target in question will crash
gyp. The exact contents of the "all" target on the android backend are
not really relevant, so this is the simplest fix.

BUG=chromium:435772
R=thakis@chromium.org

Review URL: https://codereview.chromium.org/758943002

git-svn-id: http://gyp.googlecode.com/svn/trunk@2010 78cadc50-ecff-11dd-a971-7dbc132099af

4 months agoninja/win: Let link-wrapper convert /s to \s in the linker command.
thakis@chromium.org [Tue, 25 Nov 2014 01:25:02 +0000 (01:25 +0000)]
ninja/win: Let link-wrapper convert /s to \s in the linker command.

ExecLinkWrapper() runs a subprocess with shell=True, so that "link.exe" is
looked up using PATH from the environment loaded from environment.x86 in the
build directory.

shell=True implies that forward slashes in the path to the linker (say, if a
custom linker, such as lld-link.exe is used) don't work. If the linker command
is '..\../lld-link.exe', the command with fail with
"'..\..' is not recognized as an internal or external command".

So manually replace forward slashes with backslashes in the link command before
attempting to run it.

BUG=chromium:436277
Review URL: https://codereview.chromium.org/722073004/

git-svn-id: http://gyp.googlecode.com/svn/trunk@2009 78cadc50-ecff-11dd-a971-7dbc132099af

4 months agoInitialize struct flock for AIX with O_LARGEFILE used by Python.
thakis@chromium.org [Sat, 22 Nov 2014 00:08:00 +0000 (00:08 +0000)]
Initialize struct flock for AIX with O_LARGEFILE used by Python.

gyp issue 440

Python on AIX is compiled with LARGEFILE support.  gyp flock_tool must
use the appropriate stucture member definitions to properly initialize
the structure.

BUG=
Review URL: https://codereview.chromium.org/738943004/
Patch from David Edelson <dje.gcc@gmail.com>!

git-svn-id: http://gyp.googlecode.com/svn/trunk@2008 78cadc50-ecff-11dd-a971-7dbc132099af

4 months agoAdd back support for /Gv now that gyp-win64 has VS2013
sbaig1@bloomberg.net [Fri, 21 Nov 2014 14:27:39 +0000 (14:27 +0000)]
Add back support for /Gv now that gyp-win64 has VS2013

This was removed in the last minute in r1984 because of failures in the
gyp-win64 bot.

BUG=
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/645223002

git-svn-id: http://gyp.googlecode.com/svn/trunk@2007 78cadc50-ecff-11dd-a971-7dbc132099af

4 months agoMechanical changes to cleanup pylint presubmit checks
sbaig1@bloomberg.net [Fri, 21 Nov 2014 00:14:24 +0000 (00:14 +0000)]
Mechanical changes to cleanup pylint presubmit checks

BUG=gyp:469
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/739303003

git-svn-id: http://gyp.googlecode.com/svn/trunk@2006 78cadc50-ecff-11dd-a971-7dbc132099af

4 months agoAdd support for "else if" in gyp conditions
sbaig1@bloomberg.net [Tue, 18 Nov 2014 20:08:21 +0000 (20:08 +0000)]
Add support for "else if" in gyp conditions

Right now, a gyp condition consists of exactly two or three parts:

  [cond_expr, true_dict]
  [cond_expr, true_dict, false_dict]

This means if we want to have an "else if" condition, it needs to be inside a
nested 'conditions' list inside the false_dict.  This leads to unnecessarily
deep levels of nesting in gyp files.

This commit makes it so that if the 'false_dict' is not a dict, then we will
treat it as another cond_expr.  We keep looping like this until we find a
false_dict, or until we reach the end of the list.

This means we can now have conditions that look like this:

  [cond_expr1, true_dict1, cond_expr2, true_dict2, false_dict]

or:

  [cond_expr1, true_dict1, cond_expr2, true_dict2, cond_expr3, true_dict3]

BUG=
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/601353002

git-svn-id: http://gyp.googlecode.com/svn/trunk@2004 78cadc50-ecff-11dd-a971-7dbc132099af

5 months agoninja win: Add msvs emulation for FloatingPointModel
sbaig1@bloomberg.net [Thu, 13 Nov 2014 23:17:39 +0000 (23:17 +0000)]
ninja win: Add msvs emulation for FloatingPointModel

BUG=
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/720153005

git-svn-id: http://gyp.googlecode.com/svn/trunk@2003 78cadc50-ecff-11dd-a971-7dbc132099af

5 months agowin: Use the _winreg module for registry access
sbaig1@bloomberg.net [Thu, 13 Nov 2014 19:46:28 +0000 (19:46 +0000)]
win: Use the _winreg module for registry access

This commit changes the Visual Studio installation path detection code to use
_winreg to find the installation path in the registry.  The previous method of
using reg.exe is preserved as a fallback for when '_winreg' cannot be imported
(for example in cygwin).

Also, remove the '_RegistryKeyExists' function since it is not used anywhere.

BUG=
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/724863002

git-svn-id: http://gyp.googlecode.com/svn/trunk@2002 78cadc50-ecff-11dd-a971-7dbc132099af

5 months agoRevert r1998, it breaks iOS builds
thakis@chromium.org [Wed, 12 Nov 2014 18:24:22 +0000 (18:24 +0000)]
Revert r1998, it breaks iOS builds

BUG=chromium:432483
TBR=maruel@chromium.org

Review URL: https://codereview.chromium.org/722773002

git-svn-id: http://gyp.googlecode.com/svn/trunk@2001 78cadc50-ecff-11dd-a971-7dbc132099af

5 months agoFix dependency broken on mac when building FAT binaries.
thakis@chromium.org [Tue, 11 Nov 2014 03:35:30 +0000 (03:35 +0000)]
Fix dependency broken on mac when building FAT binaries.

When trying to build shared_library or loadable_module, build.ninja
has a rule to depend on .dylib.TOC or .so.TOC.  However, WriteLink in
ninja.py forget to create the rule for .TOC for FAT binaries.
As a result, generated build.ninja won't has a rule for .TOC,
which cause build failure.

Note that I only fixed a part of the issue 411, which is needed for my goal.
I or somebody else need more work to make gyp in the issue 411 work
as epxected.

BUG=https://code.google.com/p/gyp/issues/detail?id=411
Review URL: https://codereview.chromium.org/629893002/

Patch from Yoshisato Yanagisawa <yyanagisawa@chromium.org>!

git-svn-id: http://gyp.googlecode.com/svn/trunk@2000 78cadc50-ecff-11dd-a971-7dbc132099af

5 months agoninja win: Don't return unfound VS version, raise instead
sbaig1@bloomberg.net [Mon, 10 Nov 2014 16:47:25 +0000 (16:47 +0000)]
ninja win: Don't return unfound VS version, raise instead

Like r1978, but for ninja only.  The msvs generator can use the fallback, but
the ninja generator cannot do anything without knowing the path to the VS
installation.  It is better to fail here, than to fail further along when
trying to run the setup script.

BUG=
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/708303002

git-svn-id: http://gyp.googlecode.com/svn/trunk@1999 78cadc50-ecff-11dd-a971-7dbc132099af

5 months agoSet ZERO_AR_DATE=1 when running libtool.
maruel@chromium.org [Wed, 5 Nov 2014 20:00:28 +0000 (20:00 +0000)]
Set ZERO_AR_DATE=1 when running libtool.

Ref: http://www.opensource.apple.com/source/cctools/cctools-809/misc/libtool.c

Adhoc testing with base_unittests reduced non-deterministic bytes from ~2347 to
~174. It's definitely the lowest hanging fruit, which will permit us to focus on
the remaining bytes.

R=thakis@chromium.org
BUG=chromium:330262

Review URL: https://codereview.chromium.org/699083004

git-svn-id: http://gyp.googlecode.com/svn/trunk@1998 78cadc50-ecff-11dd-a971-7dbc132099af

5 months agomsvs: Fix rule dependencies for VS2013
sbaig1@bloomberg.net [Tue, 4 Nov 2014 22:57:06 +0000 (22:57 +0000)]
msvs: Fix rule dependencies for VS2013

This commit does two things to fix rules for VS2013:

* Don't exclude rule 'input' files (i.e. the files that will be used as
  'AdditionalDependencies' in the msbuild rule definition).
* Use a 'CustomBuild' element for 'AdditionalDependencies' files, instead of
  using 'None'.  This is similar to how the primary input of actions is added
  in '_AddMSBuildAction'.

Also, re-enable the test/rules-rebuild/gyptest-default.py test for VS2013.

BUG=gyp:465
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/699203003

git-svn-id: http://gyp.googlecode.com/svn/trunk@1997 78cadc50-ecff-11dd-a971-7dbc132099af

5 months agoSwitch to 2013 now that it's what's on the bots
scottmg@chromium.org [Thu, 30 Oct 2014 21:14:14 +0000 (21:14 +0000)]
Switch to 2013 now that it's what's on the bots

Chromium only supports 2013 now, and the bots no longer have older versions.

Support for other versions still maintained, just not on buildbot.

R=sbaig1@bloomberg.net

Review URL: https://codereview.chromium.org/647043003

git-svn-id: http://gyp.googlecode.com/svn/trunk@1996 78cadc50-ecff-11dd-a971-7dbc132099af

5 months agoAdd indentation offset guess for gyp emacs mode.
thakis@chromium.org [Tue, 28 Oct 2014 16:35:40 +0000 (16:35 +0000)]
Add indentation offset guess for gyp emacs mode.

This fixes the indentation for some of the gyp files using 4 spaces
indentation instead of the usual 2.
Also adds "ldflags" in the list of keywords.

Review URL: https://codereview.chromium.org/598023002/
Patch from Fabrice de Gans <fdegans@chromium.org>!

git-svn-id: http://gyp.googlecode.com/svn/trunk@1995 78cadc50-ecff-11dd-a971-7dbc132099af

5 months agoMoves warning about invalid targets into 'invalid_targets' in result
sky@chromium.org [Fri, 24 Oct 2014 18:16:13 +0000 (18:16 +0000)]
Moves warning about invalid targets into 'invalid_targets' in result

Previously if an invalid_target was supplied analyze would report it
via 'warning'. I'm moving that warning to 'invalid_targets' and
providing the list of invalid targets there.

BUG=426892
TEST=covered by tests
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/671233004

git-svn-id: http://gyp.googlecode.com/svn/trunk@1994 78cadc50-ecff-11dd-a971-7dbc132099af

5 months agoStop checking for duplicate basenames
scottmg@chromium.org [Fri, 24 Oct 2014 00:15:48 +0000 (00:15 +0000)]
Stop checking for duplicate basenames

Chromium doesn't care about MSVC08 or Mac OS X makefiles anymore,
whereas some third_party libraries we'd like to use within Chromium
contain source files with duplicate basenames.

link: https://groups.google.com/a/chromium.org/d/msg/chromium-dev/0rDiXgLvywY/sm0LSj-hiDIJ
Patch from mdempsky@chromium.org

R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/670063006

git-svn-id: http://gyp.googlecode.com/svn/trunk@1993 78cadc50-ecff-11dd-a971-7dbc132099af

5 months agoSimplify and optimize FindCycles
scottmg@chromium.org [Wed, 22 Oct 2014 23:57:40 +0000 (23:57 +0000)]
Simplify and optimize FindCycles

Finding cycles in a directed graph only requires a simple depth first
traversal, it does not require checking every path in the graph.

This is now fast enough to actually identify and print cycles between
targets.

Changes the error message slightly for file and target cycles,
and adds tests for both those cases.

Patch from cjhopman@chromium.org.

R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/664253005

git-svn-id: http://gyp.googlecode.com/svn/trunk@1992 78cadc50-ecff-11dd-a971-7dbc132099af

5 months agoAdd (partial) support for assets catalog
sdefresne@chromium.org [Tue, 21 Oct 2014 16:37:52 +0000 (16:37 +0000)]
Add (partial) support for assets catalog

Add supports for assets catalog to ninja generator (make generator does
not support them but avoid copying the catalog into the bundle).

Only supports generating compressed catalog, so will only work if target
is Mac OS X >= 10.9 or iOS >= 7.0. Support for application icon and for
launch image is partially implemented in that there is no way to enable
it.

BUG=gyp:458

git-svn-id: http://gyp.googlecode.com/svn/trunk@1991 78cadc50-ecff-11dd-a971-7dbc132099af

6 months agoandroid: Build against NDK prebuilts, not system libraries.
torne@chromium.org [Fri, 17 Oct 2014 17:58:27 +0000 (17:58 +0000)]
android: Build against NDK prebuilts, not system libraries.

To allow the chromium WebView to build unbundled, we need to stop
linking to system libraries and instead link to the prebuilt libraries
in the NDK.

All modules compiled for target now specify LOCAL_SDK_VERSION with a
valid version of the SDK (defaulting to 19, the oldest version on which
the WebView builds). This can be overridden with the generator flag
"aosp_sdk_version".

Instead of converting library flags of the form "-lfoo" to entries in
LOCAL_SHARED_LIBRARIES, which causes a dependency on the system version
of the library, simply pass these flags through in ldflags. The NDK
library path is set automatically if LOCAL_SDK_VERSION is defined and
the correct version of these libraries will be found.

BUG=chromium:409851
R=primiano@chromium.org, thakis@chromium.org

Review URL: https://codereview.chromium.org/571053003

git-svn-id: http://gyp.googlecode.com/svn/trunk@1990 78cadc50-ecff-11dd-a971-7dbc132099af

6 months agogypd: update with required default variables.
torne@chromium.org [Mon, 13 Oct 2014 08:43:33 +0000 (08:43 +0000)]
gypd: update with required default variables.

Update the list of identity variables in gypd so that the generator will
run successfully on Chromium, which uses these variables predefined by
other generators.

BUG=
R=bradnelson@google.com

Review URL: https://codereview.chromium.org/642933007

git-svn-id: http://gyp.googlecode.com/svn/trunk@1989 78cadc50-ecff-11dd-a971-7dbc132099af

6 months agoAdd Ninja support for MSVS $(TargetExt), $(TargetFileName) and $(TargetPath) macros.
chrisha@chromium.org [Mon, 6 Oct 2014 14:17:54 +0000 (14:17 +0000)]
Add Ninja support for MSVS $(TargetExt), $(TargetFileName) and $(TargetPath) macros.

BUG=gyp:462
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/629543002

git-svn-id: http://gyp.googlecode.com/svn/trunk@1988 78cadc50-ecff-11dd-a971-7dbc132099af

6 months agoninja: Don't rerun actions/rules based on where gyp was invoked
sbaig1@bloomberg.net [Fri, 26 Sep 2014 16:14:11 +0000 (16:14 +0000)]
ninja: Don't rerun actions/rules based on where gyp was invoked

Right now, ninja generates unique names for actions/rules by combining the
action/rule name with a hash on the qualified_target.  However, the path of the
qualified_target is relative to where gyp was invoked from.  So, the following
gyp command:

  gyp --depth=. foo/bar.gyp

will generate a different hash than:

  cd foo
  gyp --depth=../ bar.gyp

Since the hash is different, this causes actions/rules to get rerun based on
where gyp happened to be invoked from.

This commit fixes this issue by using a qualified_target relative to the
toplevel_dir, rather than the current working directory.  Also, the
self.qualified_target in NinjaWriter is only used for the hash, so we can
remove it and replace it with a precomputed hash for all actions/rules.

BUG=
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/607083002

git-svn-id: http://gyp.googlecode.com/svn/trunk@1987 78cadc50-ecff-11dd-a971-7dbc132099af

6 months agoAdd support for MIDL include directories
sbaig1@bloomberg.net [Thu, 25 Sep 2014 19:00:01 +0000 (19:00 +0000)]
Add support for MIDL include directories

This adds support for 'midl_include_dirs', which is handled like 'include_dirs'
and 'resource_include_dirs', except this is for the MIDL tool.

One notable difference is that, unlike 'resource_include_dirs', the
'midl_include_dirs' property doesn't default to 'include_dirs'.  This is to
prevent any change in behavior for any existing gyp files that don't set
'midl_include_dirs'.  Also, MIDL include directories are quite a different
concept to C/C++ include directories.

BUG=
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/602073003

git-svn-id: http://gyp.googlecode.com/svn/trunk@1986 78cadc50-ecff-11dd-a971-7dbc132099af

6 months agoAdded msvs_enable_winrt to enable creating Windows Store compatible projects for...
scottmg@chromium.org [Thu, 25 Sep 2014 16:48:09 +0000 (16:48 +0000)]
Added msvs_enable_winrt to enable creating Windows Store compatible projects for .dlls that are consumed by WinRT applications.

Patch from coopp@microsoft.com.

BUG=
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/607553002

git-svn-id: http://gyp.googlecode.com/svn/trunk@1985 78cadc50-ecff-11dd-a971-7dbc132099af

6 months agoninja win: Add support for 'CallingConvention'
sbaig1@bloomberg.net [Wed, 24 Sep 2014 21:53:35 +0000 (21:53 +0000)]
ninja win: Add support for 'CallingConvention'

Each calling convention decorates C functions in a different way, so we can use
that to test the flag.

BUG=
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/597993003

git-svn-id: http://gyp.googlecode.com/svn/trunk@1984 78cadc50-ecff-11dd-a971-7dbc132099af

6 months agoRevert "I need this change to create Windows 8.1/Windows Phone 8.1 projects that...
scottmg@chromium.org [Wed, 24 Sep 2014 20:14:25 +0000 (20:14 +0000)]
Revert "I need this change to create Windows 8.1/Windows Phone 8.1 projects that compile modules that can be consumed by Windows Store Applications (WinRT)."

This reverts commit 397b1c684b0b07a38f485f091cc4394a3d733334.

Failing on win64 bots per http://build.chromium.org/p/tryserver.nacl/builders/gyp-win64/builds/1896

BUG=

Review URL: https://codereview.chromium.org/596023003

git-svn-id: http://gyp.googlecode.com/svn/trunk@1983 78cadc50-ecff-11dd-a971-7dbc132099af

6 months agoRevert r1978 and r1979
scottmg@chromium.org [Tue, 23 Sep 2014 18:39:42 +0000 (18:39 +0000)]
Revert r1978 and r1979

BUG=

Review URL: https://codereview.chromium.org/594923002

git-svn-id: http://gyp.googlecode.com/svn/trunk@1982 78cadc50-ecff-11dd-a971-7dbc132099af

6 months agoI need this change to create Windows 8.1/Windows Phone 8.1 projects that compile...
scottmg@chromium.org [Tue, 23 Sep 2014 17:04:00 +0000 (17:04 +0000)]
I need this change to create Windows 8.1/Windows Phone 8.1 projects that compile modules that can be consumed by Windows Store Applications (WinRT).

This change is required as a prerequisite to adding proper Windows Store (8.1 only) support to Google's ANGLE codebase.

Patch from coopp@microsoft.com.

R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/521693002

git-svn-id: http://gyp.googlecode.com/svn/trunk@1981 78cadc50-ecff-11dd-a971-7dbc132099af

6 months agoAdds swift file support to xcode generation.
justincohen@chromium.org [Tue, 23 Sep 2014 16:48:48 +0000 (16:48 +0000)]
Adds swift file support to xcode generation.

BUG=
Patch from Josh Converse <jconverse@google.com>!

R=justincohen@chromium.org, thomasvl@chromium.org

Review URL: https://codereview.chromium.org/560683003

git-svn-id: http://gyp.googlecode.com/svn/trunk@1980 78cadc50-ecff-11dd-a971-7dbc132099af

6 months agoDon't run windows tests on other platforms
scottmg@chromium.org [Tue, 23 Sep 2014 16:48:45 +0000 (16:48 +0000)]
Don't run windows tests on other platforms

Build fix

TBR=timurrrr@chromium.org

Review URL: https://codereview.chromium.org/598643003

git-svn-id: http://gyp.googlecode.com/svn/trunk@1979 78cadc50-ecff-11dd-a971-7dbc132099af

6 months agoDon't return unfound VS version, raise instead
scottmg@chromium.org [Tue, 23 Sep 2014 16:21:23 +0000 (16:21 +0000)]
Don't return unfound VS version, raise instead

This fallback behaviour may have worked at some point, but doesn't
any more, so simply error out with a clear message rather than trying
to continue.

R=timurrrr@chromium.org
BUG=https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/O_OGfq2nhSw

Review URL: https://codereview.chromium.org/595543003

git-svn-id: http://gyp.googlecode.com/svn/trunk@1978 78cadc50-ecff-11dd-a971-7dbc132099af

7 months agoandroid: Add a way to override build system variables.
torne@chromium.org [Fri, 12 Sep 2014 16:06:22 +0000 (16:06 +0000)]
android: Add a way to override build system variables.

Add a key 'aosp_build_settings' which a target can use to set Android
build system variables in the generated makefile, for edge cases not
directly supported by gyp. aosp_build_settings is a dictionary which
maps variable names to values (values may be integers, strings or lists;
all values will be quoted appropriately for make and lists will be
converted to whitespace-separated form).

BUG=
R=primiano@chromium.org, thakis@chromium.org

Review URL: https://codereview.chromium.org/565743004

git-svn-id: http://gyp.googlecode.com/svn/trunk@1977 78cadc50-ecff-11dd-a971-7dbc132099af

7 months agoandroid: Don't emit useless info into generated makefiles.
torne@chromium.org [Fri, 12 Sep 2014 14:59:29 +0000 (14:59 +0000)]
android: Don't emit useless info into generated makefiles.

To make the generated makefiles smaller and slightly easier to debug,
omit information that is useless:

* Don't emit LDFLAGS for static libraries as the linker is not invoked.

* For static libraries, only include system libraries in the lists of
  libraries to link against. The system libraries are required in case
  they provide implicit include paths, but there's no need to include
  the large list of gyp-generated targets.

* Don't emit empty lists of libraries to link against.

* Don't bother setting LOCAL_MODULE_TAGS to optional as that's the
  default value.

Also, stop attempting to remove standard system include paths; the list
is out of date, never matches anything in the Chromium build, and it
doesn't really matter if a standard path is duplicated anyway.

BUG=
R=primiano@chromium.org

Review URL: https://codereview.chromium.org/565883002

git-svn-id: http://gyp.googlecode.com/svn/trunk@1976 78cadc50-ecff-11dd-a971-7dbc132099af

7 months agoFix indentation for emacs and add missing keyword.
thakis@chromium.org [Fri, 12 Sep 2014 00:06:30 +0000 (00:06 +0000)]
Fix indentation for emacs and add missing keyword.

Closing brackets are now properly indented with the opening
bracket.
Also adds "cflags_cc" in the list of keywords

BUG=
Review URL: https://codereview.chromium.org/560263003/
R=gavinp@chromium.org

Patch from Fabrice de Gans-Riberi <fdegans@chromium.org>!

git-svn-id: http://gyp.googlecode.com/svn/trunk@1975 78cadc50-ecff-11dd-a971-7dbc132099af

7 months agoChanges ninja generator to only output empty names if not already output
sky@chromium.org [Tue, 9 Sep 2014 14:36:16 +0000 (14:36 +0000)]
Changes ninja generator to only output empty names if not already output

This builds on https://codereview.chromium.org/543743003/ .

BUG=410410
TEST=covered by test now
R=thakis@chromium.org

Review URL: https://codereview.chromium.org/547393003

git-svn-id: http://gyp.googlecode.com/svn/trunk@1974 78cadc50-ecff-11dd-a971-7dbc132099af

7 months agoChanges the ninja generator to output phony targets for uninteresting targets
sky@chromium.org [Thu, 4 Sep 2014 23:59:54 +0000 (23:59 +0000)]
Changes the ninja generator to output phony targets for uninteresting targets

This way you can pass these targets to the build system and not get
errors.

BUG=410410
TEST=covered by test now
R=thakis@chromium.org

Review URL: https://codereview.chromium.org/543743003

git-svn-id: http://gyp.googlecode.com/svn/trunk@1973 78cadc50-ecff-11dd-a971-7dbc132099af

7 months agoMakes matching of build files work when absolute
sky@chromium.org [Tue, 2 Sep 2014 22:12:00 +0000 (22:12 +0000)]
Makes matching of build files work when absolute

Matching wasn't working if paths supplied were absolute. gyp_chromium
triggers absolute paths, so picking up modified gyp/gypi files wasn't
working when analyzer run from chrome.

BUG=109173
TEST=none
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/534793002

git-svn-id: http://gyp.googlecode.com/svn/trunk@1972 78cadc50-ecff-11dd-a971-7dbc132099af

7 months agoSupport for custom NM/readelf binaries in your toolchain.
dimator@google.com [Thu, 28 Aug 2014 21:12:58 +0000 (21:12 +0000)]
Support for custom NM/readelf binaries in your toolchain.

Background: nm and readelf are used by ninja.py to generate
.TOC files. These .TOC files are what determine when something
needs rebuilding.

ninja.py uses distinct commands for host vs target tools for most things
in the toolchain (cc, c++, ld,), via make_global_settings, but it fails to do so
for nm & readelf. This is not by design, but it has worked thus far by chance:
The default 'nm' and 'readelf' in most people's PATH are the system variants,
and the Linux versions of these tools happen to work.

However, the project I'm working on has engineers on Macs developing for
android. The system-supplied 'nm' and 'readelf' on Mac do NOT work for
e.g. Android arm binaries, which leads me to this fix. This fix allows for
specifying NM and READELF via make_global_settings, so we can point those
variables to the correct ones for the given toolchain/target.

BUG=
R=thakis@chromium.org

Review URL: https://codereview.chromium.org/164023009

git-svn-id: http://gyp.googlecode.com/svn/trunk@1971 78cadc50-ecff-11dd-a971-7dbc132099af

7 months agoandroid: Support host multilib builds.
thakis@chromium.org [Mon, 25 Aug 2014 17:53:17 +0000 (17:53 +0000)]
android: Support host multilib builds.

The Android build system now supports multilib 32/64-bit host builds as
well as target builds, and Chromium needs to make use of this to
properly support compiling V8 for host. Introduce a GYP_HOST_VAR_PREFIX
variable that works equivalently to GYP_VAR_PREFIX and use it in all the
places where the first/second host architecture must be selected, and
also introduce GYP_HOST_MULTILIB to enable the top level makefile to
specify whether it wants 32-bit or 64-bit host binaries.

BUG=chromium:358141
Review URL: https://codereview.chromium.org/301373002

Patch from Torne <torne@chromium.org>!

git-svn-id: http://gyp.googlecode.com/svn/trunk@1970 78cadc50-ecff-11dd-a971-7dbc132099af

7 months agoMakes analyzer output names of all executable target types
sky@chromium.org [Fri, 22 Aug 2014 22:11:19 +0000 (22:11 +0000)]
Makes analyzer output names of all executable target types

This makes it easier to detect if something is going to be built
without knowing all the names of dependent targets. For example, in
chrome it's typical to have a _run target, eg
browser_tests_run. Without this the chrome side would have to look for
all the _foo targets.

BUG=109173
TEST=none
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/496363004

git-svn-id: http://gyp.googlecode.com/svn/trunk@1969 78cadc50-ecff-11dd-a971-7dbc132099af

7 months agoandroid: Make buildbot able to use a custom manifest.
torne@chromium.org [Fri, 22 Aug 2014 16:12:24 +0000 (16:12 +0000)]
android: Make buildbot able to use a custom manifest.

In order to support rolling to a new version of AOSP to run gyp tests
(to pick up android build system changes), introduce logic in the
buildbot script to compare the current manifest being used with the one
in the gyp tree and resync/compile android if it changes. Check in an
initial version of this manifest which is pinned to a recent revision of
AOSP's master branch.

BUG=gyp:324
R=jbudorick@chromium.org, torne@chromium.org

Review URL: https://codereview.chromium.org/493743002

git-svn-id: http://gyp.googlecode.com/svn/trunk@1968 78cadc50-ecff-11dd-a971-7dbc132099af

8 months agoninja win: don't expect pdb to be generated when GenerateDebugInformation: false
scottmg@chromium.org [Tue, 19 Aug 2014 00:32:02 +0000 (00:32 +0000)]
ninja win: don't expect pdb to be generated when GenerateDebugInformation: false

if comparison was incorrect for truthy values when added at
https://codereview.chromium.org/126443004/ (such as 'false').

Test addition fails before this CL.

R=thakis@chromium.org, sky@chromium.org
BUG=chromium:404872

Review URL: https://codereview.chromium.org/483133002

git-svn-id: http://gyp.googlecode.com/svn/trunk@1967 78cadc50-ecff-11dd-a971-7dbc132099af

8 months agoMakes the analyzer output the set of targets needing a build
sky@chromium.org [Mon, 18 Aug 2014 20:24:09 +0000 (20:24 +0000)]
Makes the analyzer output the set of targets needing a build

The set of build targets is the minimal set of targets reachable
from the all target that contains one of the specified files (matched
target), or depeneds on the set of matched targets.

BUG=109173
TEST=none
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/481433003

git-svn-id: http://gyp.googlecode.com/svn/trunk@1966 78cadc50-ecff-11dd-a971-7dbc132099af

8 months agoRemoves old way to specify files to look for
sky@chromium.org [Wed, 13 Aug 2014 16:40:36 +0000 (16:40 +0000)]
Removes old way to specify files to look for

This was from the first version and is no longer used. Also cleaned up
tests as well.

BUG=none
TEST=none
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/473483002

git-svn-id: http://gyp.googlecode.com/svn/trunk@1965 78cadc50-ecff-11dd-a971-7dbc132099af

8 months agoProvide a way to suppress implicit MIDL generation rules for actions
scottmg@chromium.org [Tue, 12 Aug 2014 03:35:56 +0000 (03:35 +0000)]
Provide a way to suppress implicit MIDL generation rules for actions

For IDL files, GYP ninja normally generates rules to build MIDL
unless there are explicit rules. This special casing only works
for rules, but not actions.
In blink, we are going to add an action which runs blink's IDL compiler
to generate IDL dictionary implementation .h/.cpp files, which means
that we need a way to similar logic for actions.
This CL introduces 'explicit_idl_action' flag for such purpose.

Patch from bashi@chromium.org.

R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/440293002

git-svn-id: http://gyp.googlecode.com/svn/trunk@1964 78cadc50-ecff-11dd-a971-7dbc132099af

8 months agoStyle changes for analyzer
sky@chromium.org [Wed, 6 Aug 2014 20:47:13 +0000 (20:47 +0000)]
Style changes for analyzer
__ -> _
and lots of single newlines to double newlines.

BUG=none
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/445113002

git-svn-id: http://gyp.googlecode.com/svn/trunk@1963 78cadc50-ecff-11dd-a971-7dbc132099af

8 months agoCurrently I've special cased gyp* file modifications higher in the
sky@chromium.org [Wed, 6 Aug 2014 16:41:05 +0000 (16:41 +0000)]
Currently I've special cased gyp* file modifications higher in the
stack. By that I mean if a gyp* file has been modified I don't run
analyze and assume everything has changed. This change adds support
for modification to gyp* files. If a gyp* file has changed it assumes
all targets in the file are modified. Similarly if an included file
has been modified all targets in the file that did the include are
considered modified. Lastly, if one of the modified files is specified
on the command line via -I the I early out and assume everything needs
to be recompiled.

BUG=109173
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/442083004

git-svn-id: http://gyp.googlecode.com/svn/trunk@1962 78cadc50-ecff-11dd-a971-7dbc132099af

8 months agoPull in relevant targets when using xcode-ninja
sdefresne@chromium.org [Fri, 1 Aug 2014 09:42:18 +0000 (09:42 +0000)]
Pull in relevant targets when using xcode-ninja

The tests gyptest-actions, gyptest-copies and gyptest-rules fail when
using the xcode-ninja generator because xcode-ninja (by design) only
creates targets for proper executables. In order for these three tests
to pass, the targets they rely on need to be included explicitly.

BUG=gyp:442

TEST=Run
    ./gyptest.py -f xcode-ninja test/generator-output/

Expected: all tests pass (instead of failing the three mentioned above).

R=sdefresne@chromium.org, justincohen@chromium.org

Review URL: https://codereview.chromium.org/423753003

git-svn-id: http://gyp.googlecode.com/svn/trunk@1961 78cadc50-ecff-11dd-a971-7dbc132099af

8 months agoGuard against configurations without 'xcode_settings'
sdefresne@chromium.org [Fri, 1 Aug 2014 09:21:10 +0000 (09:21 +0000)]
Guard against configurations without 'xcode_settings'

e.g. test/generator-output/src/prog1.gyp

TEST=Run
    ./gyptest.py -f xcode-ninja test/generator-output/gyptest-top-all.py

Expected to fail with
    OSError: [Errno 13] Permission denied: 'prog1.ninja.xcworkspace'
(instead of KeyError: 'xcode_settings')

R=sdefresne@chromium.org, justincohen@chromium.org

Review URL: https://codereview.chromium.org/428913002

git-svn-id: http://gyp.googlecode.com/svn/trunk@1960 78cadc50-ecff-11dd-a971-7dbc132099af

8 months agoUpdates analyzer to output to a file
sky@chromium.org [Wed, 30 Jul 2014 20:29:26 +0000 (20:29 +0000)]
Updates analyzer to output to a file

File is specified by way of analyzer_output_path. I'm also changing
from a hard error if a target can't be found to a warning.

I'm also including a new set of tests. I forgot to svn add this last
time around.

BUG=109173
TEST=covered by tests
R=mark@chromium.org

Review URL: https://codereview.chromium.org/429243003

git-svn-id: http://gyp.googlecode.com/svn/trunk@1959 78cadc50-ecff-11dd-a971-7dbc132099af

8 months agoAvoid infinite recursion with identity variables.
mark@chromium.org [Tue, 29 Jul 2014 15:13:34 +0000 (15:13 +0000)]
Avoid infinite recursion with identity variables.

Some generators like gypd and gypsh define the generator_default_variables
as an identity expansion. For example, the variable 'INTERMEDIATE_DIR'
would expand to '<(INTERMEDIATE_DIR)' which lends to an infinite recursion
if a .gyp file uses any of those variables.

This patch detects trivial infinite recursive variable expansions like
this one and leaves them that way.

Patch by Alejandro Deymonnaz <deymo@chromium.org>

BUG=141
TEST=`gyp --debug=variables --format=gypd test.gyp` shows avoiding
infinite recursion message when test.gyp has an INTERMEDIATE_DIR
variable expansion.

Review URL: https://codereview.chromium.org/417113009/

git-svn-id: http://gyp.googlecode.com/svn/trunk@1958 78cadc50-ecff-11dd-a971-7dbc132099af

8 months agoEnable custom suffixes for Mac bundles.
mark@chromium.org [Tue, 29 Jul 2014 14:02:18 +0000 (14:02 +0000)]
Enable custom suffixes for Mac bundles.

Patch by Johannes Sartisohn <jsartisohn@google.com>

Review URL: https://codereview.chromium.org/401633002/

git-svn-id: http://gyp.googlecode.com/svn/trunk@1957 78cadc50-ecff-11dd-a971-7dbc132099af

8 months agoChanges analyzer to search for targets
sky@chromium.org [Mon, 28 Jul 2014 22:36:40 +0000 (22:36 +0000)]
Changes analyzer to search for targets

Here's a list of the changes:
. I'm changing input file to be a JSON file. This allows for passing
  in more information, such as the set of targets to search for.
. Changing output format to be JSON as well. This allows for more
  structure in outputting other random data. I'm a bit iffy on whether
  this is good, but it's requested by the recipes side of things which
  uses analyzer.
. You can now specify a set of targets to search for in addition to
  files. This is intended for things like 'unittests' so that only the
  set of targets that are effected by the change get run.

To enable the new functionality you have to pass in a new switch. Once
I integrate these changes into the rest of the stack. I'll remove the
old flow.

BUG=109173
TEST=covered by tests
R=mark@chromium.org

Review URL: https://codereview.chromium.org/420383002

git-svn-id: http://gyp.googlecode.com/svn/trunk@1956 78cadc50-ecff-11dd-a971-7dbc132099af

8 months agoninja: Add support for 'ninja_use_console' in actions/rules
sbaig1@bloomberg.net [Fri, 25 Jul 2014 13:29:18 +0000 (13:29 +0000)]
ninja: Add support for 'ninja_use_console' in actions/rules

Setting this to 1 will make ninja use 'pool = console' for the action/rule.

BUG=
R=thakis@chromium.org

Review URL: https://codereview.chromium.org/412283002

git-svn-id: http://gyp.googlecode.com/svn/trunk@1955 78cadc50-ecff-11dd-a971-7dbc132099af

8 months agoThis CL adds support for extension in GYP.
sdefresne@chromium.org [Thu, 24 Jul 2014 08:10:57 +0000 (08:10 +0000)]
This CL adds support for extension in GYP.

This CL adds the extension target type and adds the link flags to
compile .appex extensions.

BUG=gyp:435
R=justincohen@chromium.org, mark@chromium.org, pkl@chromium.org, sdefresne@chromium.org

Review URL: https://codereview.chromium.org/376603002

git-svn-id: http://gyp.googlecode.com/svn/trunk@1954 78cadc50-ecff-11dd-a971-7dbc132099af

8 months agoninja/win: Put common msvs_system_include_dirs into %INCLUDE%
thakis@chromium.org [Sun, 20 Jul 2014 16:12:36 +0000 (16:12 +0000)]
ninja/win: Put common msvs_system_include_dirs into %INCLUDE%

Paths in INCLUDE are considered system headers by clang-cl and it will suppress
warnings from system headers.

BUG=chromium:395405
Review URL: https://codereview.chromium.org/406523005/

git-svn-id: http://gyp.googlecode.com/svn/trunk@1953 78cadc50-ecff-11dd-a971-7dbc132099af

8 months agoAdd test files for https://codereview.chromium.org/406523005/
thakis@chromium.org [Sun, 20 Jul 2014 05:57:33 +0000 (05:57 +0000)]
Add test files for https://codereview.chromium.org/406523005/

Maybe the try failures are due to the try server not adding the new files
correctly, since the test passes for me locally. Add the test files in a
separate commit (not used by anything yet) to test this theory.

git-svn-id: http://gyp.googlecode.com/svn/trunk@1952 78cadc50-ecff-11dd-a971-7dbc132099af

9 months agoFixes bug in path handling of analyzer
sky@chromium.org [Wed, 16 Jul 2014 22:54:32 +0000 (22:54 +0000)]
Fixes bug in path handling of analyzer

Was using os.getcwd when it needs to use options.toplevel_dir

R=mark@chromium.org
BUG=383609
TEST=none

Review URL: https://codereview.chromium.org/395483002

git-svn-id: http://gyp.googlecode.com/svn/trunk@1951 78cadc50-ecff-11dd-a971-7dbc132099af

9 months agoFixes two bugs in analyzer
sky@chromium.org [Fri, 11 Jul 2014 16:21:43 +0000 (16:21 +0000)]
Fixes two bugs in analyzer

Wasn't delaing with relative paths outside the repo. NACL does this
for things like /usr/include/...
When combining relative paths I was missing adding a '/'. This result
in paths like baseobserver_list.h instead of base/observer_list.h.

BUG=383609
TEST=covered by unit tests
R=mark@chromium.org

Review URL: https://codereview.chromium.org/383893003

git-svn-id: http://gyp.googlecode.com/svn/trunk@1949 78cadc50-ecff-11dd-a971-7dbc132099af

9 months agoXcode: Add xcdatamodeld = wrapper.xcdatamodeld in extension_map
mark@chromium.org [Thu, 26 Jun 2014 13:09:08 +0000 (13:09 +0000)]
Xcode: Add xcdatamodeld = wrapper.xcdatamodeld in extension_map

.xcdatamodeld documents are used for Model File Format.
https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/CoreDataVersioning/Articles/vmModelFormat.html

Note that .xcdatamodel has already been supported since gyp r1529.

BUG=303

Patch from Roberto Cosenza <robcos@google.com>
via Yohei Yukawa <yukawa@chromium.org>

Review URL: https://codereview.chromium.org/351223002/

git-svn-id: http://gyp.googlecode.com/svn/trunk@1948 78cadc50-ecff-11dd-a971-7dbc132099af

9 months agoIntroduce '--no-duplicate-basename-check' option to disable the check of duplicate...
yukawa@chromium.org [Wed, 25 Jun 2014 01:48:30 +0000 (01:48 +0000)]
Introduce '--no-duplicate-basename-check' option to disable the check of duplicate basenames

With this CL, the check of duplicate basenames in the same source list can be disabled with '--no-duplicate-basename-check' option.

Now GYP generators can handle duplicate basenames except for VCProj generator for Visual C++ 2008 and Makefile generator on Mac. Given that these two generators are no longer actively used, and supposed to be deprecated in future, providing an option to disable this validation should be helpful for some GYP users.

Note that these two generators continue to treat duplicate basenames continue as an error regardless of '--no-duplicate-basename-check'.

BUG=gyp:264, gyp:384
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/344573002

git-svn-id: http://gyp.googlecode.com/svn/trunk@1947 78cadc50-ecff-11dd-a971-7dbc132099af

9 months agoMakes analyzer strip off a leading path separator
mark@chromium.org [Mon, 23 Jun 2014 18:18:44 +0000 (18:18 +0000)]
Makes analyzer strip off a leading path separator

When running in chrome paths are absolute.

Also makes chrome build work with analyzer on windows. The specific define I
ran into was MSVS_OS_BITS, but I'm sure there are more.

BUG=chromium:383609
R=mark@chromium.org

Patch by Scott Violet <sky@chromium.org>
Review URL: https://codereview.chromium.org/347193005/

git-svn-id: http://gyp.googlecode.com/svn/trunk@1946 78cadc50-ecff-11dd-a971-7dbc132099af

9 months agomsvs: ensure that failing actions make the build fail with multiple actions
scottmg@chromium.org [Fri, 20 Jun 2014 17:42:59 +0000 (17:42 +0000)]
msvs: ensure that failing actions make the build fail with multiple actions

The old way of joining multiple commands would take care of failing correctly
when there are multiple actions associated with a single file. However, for
multiple actions associated with different files (but within the same target),
Visual Studio will still create just one .bat file for them all, so we must
make sure that each command errors out correctly when it fails.

Strictly speaking, the %errorlevel% check is unnecessary for the last command
in a target (because the .bat file created by VS contains it already); but it
doesn't hurt either, and makes the logic much simpler.

Patch from Stefan Haller <stk.haller@googlemail.com>.

R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/335273006

git-svn-id: http://gyp.googlecode.com/svn/trunk@1945 78cadc50-ecff-11dd-a971-7dbc132099af

10 months agoninja: Pass .so files outside of --start-group/--end-group.
thakis@chromium.org [Tue, 17 Jun 2014 23:59:21 +0000 (23:59 +0000)]
ninja: Pass .so files outside of --start-group/--end-group.

When doing 32bit release component builds of chromium, nacl_helper fails to
link like so:

g++ [...] -Wl,--as-needed -o nacl_helper -Wl,--start-group [...] obj/components/libnacl_linux.a [...] lib/libppapi_shared.so -Wl,--end-group [...]

  /usr/bin/ld: .../nacl_linux.plugin_main.o: undefined reference to symbol '_ZN5ppapi16PPB_Audio_Shared18SetThreadFunctionsEPK18PP_ThreadFunctions'
  /usr/bin/ld: note: '_ZN5ppapi16PPB_Audio_Shared18SetThreadFunctionsEPK18PP_ThreadFunctions' is defined in DSO lib/libppapi_shared.so so try adding it to the linker command line

Note that libppapi_shared.so is on the link line.  The error goes away if
--as-needed isn't passed, if I use gold, or if the .so file is moved after
--end-group.  http://wiki.gentoo.org/wiki/Project:Quality_Assurance/As-needed
suggests that --as-needed has additional constraints on library ordering, and
I'm guessing that this error depends on how the implementations of
--as-needed and --start-group/--end-group in ld.bfd interact.

Moving $solibs out of --start-group/--end-group seems to work, so just do that.
No test because we have no 32bit linux gyp bot.

BUG=none (but found while working on 368384 / 385472)
TEST=Build nacl_test on a 32bit release bot using the components build. links correctly
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/341613003

git-svn-id: http://gyp.googlecode.com/svn/trunk@1944 78cadc50-ecff-11dd-a971-7dbc132099af

10 months ago[gyp][Android] Implement TestGypAndroid.run_built_executable.
torne@chromium.org [Tue, 17 Jun 2014 11:39:16 +0000 (11:39 +0000)]
[gyp][Android] Implement TestGypAndroid.run_built_executable.

Note that this includes buildbot steps to start and stop an Android emulator
for testing.

BUG=gyp:324
R=bradnelson@google.com, torne@chromium.org

Review URL: https://codereview.chromium.org/321953005

git-svn-id: http://gyp.googlecode.com/svn/trunk@1943 78cadc50-ecff-11dd-a971-7dbc132099af

10 months agoTeach Ninja generator about 'AR.host' specified in 'make_global_settings'.
yukawa@chromium.org [Mon, 16 Jun 2014 17:37:45 +0000 (17:37 +0000)]
Teach Ninja generator about 'AR.host' specified in 'make_global_settings'.

With this CL, Ninja generator starts recognizing 'AR.host' specified in 'make_global_settings', like Make generator.

BUG=gyp:434
TEST=unittest
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/333353002

git-svn-id: http://gyp.googlecode.com/svn/trunk@1942 78cadc50-ecff-11dd-a971-7dbc132099af

10 months agoTeach Ninja generator about 'LD'/'LD.host' specified in 'make_global_settings_ld'.
yukawa@chromium.org [Mon, 16 Jun 2014 16:12:51 +0000 (16:12 +0000)]
Teach Ninja generator about 'LD'/'LD.host' specified in 'make_global_settings_ld'.

With this CL, Ninja generator starts recognizing 'LD'/'LD.host' specified in 'make_global_settings', like Make generator.  This makes it easier for you to share the code among host/NaCl/NDK/Emscripten build targets.

BUG=gyp:434
TEST=unittest
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/335443007

git-svn-id: http://gyp.googlecode.com/svn/trunk@1941 78cadc50-ecff-11dd-a971-7dbc132099af

10 months agoRevise unittest for 'AR' in 'make_global_settings'
yukawa@chromium.org [Mon, 16 Jun 2014 16:09:41 +0000 (16:09 +0000)]
Revise unittest for 'AR' in 'make_global_settings'

This is a follow up CL for r1931 and r1935. This is just a revise of a unittest and does not changes existing functionality.

It turned out that we need to specify GYP_CROSSCOMPILE=1 to test 'AR'/'AR.host'
properly. Expected results, which correspond to the current behavior atually, are updated accordingly.

BUG=gyp:434
TEST=unittest
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/336953002

git-svn-id: http://gyp.googlecode.com/svn/trunk@1940 78cadc50-ecff-11dd-a971-7dbc132099af

10 months agoRevise unittest for 'LD' in 'make_global_settings'
yukawa@chromium.org [Sat, 14 Jun 2014 05:45:51 +0000 (05:45 +0000)]
Revise unittest for 'LD' in 'make_global_settings'

This is a follow up CL for r1937. This is just a revise of a unittest and does not changes existing functionality.

It turned out that we need to specify GYP_CROSSCOMPILE=1 to test 'LD'/'LD.host' properly. Expected results, which are expected to be describing the current behavior, are updated accordingly.

BUG=gyp:434
TEST=unittest
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/338523003

git-svn-id: http://gyp.googlecode.com/svn/trunk@1939 78cadc50-ecff-11dd-a971-7dbc132099af

10 months agoRemove unused parameters from test code.
torne@chromium.org [Fri, 13 Jun 2014 09:47:03 +0000 (09:47 +0000)]
Remove unused parameters from test code.

Newer versions of the Android build system have -Wunused-params enabled
by default. Drop the many unused argc/argv parameters from test C/C++
code and also (void) a parameter in a dummy malloc function. This avoids
having to come up with a convoluted way to disable the warning flag in
every test.

BUG=gyp:433
R=thakis@chromium.org

Review URL: https://codereview.chromium.org/316163002

git-svn-id: http://gyp.googlecode.com/svn/trunk@1938 78cadc50-ecff-11dd-a971-7dbc132099af

10 months agoAdd unittest for 'LD' in 'make_global_settings'
yukawa@chromium.org [Fri, 13 Jun 2014 01:10:39 +0000 (01:10 +0000)]
Add unittest for 'LD' in 'make_global_settings'

This CL describes the current behavior with some unittests, before making Ninja generator aware of 'LD' in 'make_global_settings'. See gyp r1931 for the background.

BUG=gyp:434
TEST=unittest
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/322973006

git-svn-id: http://gyp.googlecode.com/svn/trunk@1937 78cadc50-ecff-11dd-a971-7dbc132099af

10 months agoFirst crack at adding a GYP_GENERATOR for determining various things
mark@chromium.org [Thu, 12 Jun 2014 22:52:48 +0000 (22:52 +0000)]
First crack at adding a GYP_GENERATOR for determining various things

This version reads a file to get a list of input files, then outputs
if any of the input files are contained as sources (or inputs to
actions/rules) in any targets.

R=mark@chromium.org

Patch by Scott Violet <sky@chromium.org>

Review URL: https://codereview.chromium.org/330053003

git-svn-id: http://gyp.googlecode.com/svn/trunk@1936 78cadc50-ecff-11dd-a971-7dbc132099af