external/gyp.git
5 days agoAdd support for generating an Eclipse .classpath file master
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

7 days 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

8 days 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

2 weeks 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

2 weeks 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

2 weeks 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

3 weeks 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

3 weeks 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

3 weeks 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

3 weeks 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 weeks 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

4 weeks 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

4 weeks 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 weeks 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 weeks 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 weeks 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

6 weeks 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

6 weeks 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

6 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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

8 weeks 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

8 weeks 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

4 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

4 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

4 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

4 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

4 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

4 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

4 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

4 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

4 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

4 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

4 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

4 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

4 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

4 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

5 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

5 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

5 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

5 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

5 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

5 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 months agoTeach Ninja generator about 'AR' in 'make_global_settings'
yukawa@chromium.org [Thu, 12 Jun 2014 17:35:33 +0000 (17:35 +0000)]
Teach Ninja generator about 'AR' in 'make_global_settings'

With this CL, 'AR' in 'make_global_settings' can be recognized by Ninja generator, like Make generator. This makes it easier for you to share the code among host/NaCl/NDK/Emscripten build targets.

Note that 'AR.host' is not yet supported with this CL.

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

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

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

6 months agoUse context manager to manage OS environment in tests
yukawa@chromium.org [Thu, 12 Jun 2014 13:25:40 +0000 (13:25 +0000)]
Use context manager to manage OS environment in tests

This is a follow up CL for gyp r1931, just for the code cleanup.  Inspired by Nico's gyp r1893.

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

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

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

6 months agoninja win: Remove obsolete comment, and make sure cc/cxx are always overridden
scottmg@chromium.org [Wed, 11 Jun 2014 23:52:16 +0000 (23:52 +0000)]
ninja win: Remove obsolete comment, and make sure cc/cxx are always overridden

Builds on discussion in https://codereview.chromium.org/321813002/.

Make sure that cc_host and cxx_host are also set to a valid compiler,
which fixes the cflags test.

R=yukawa@chromium.org
BUG=chromium:233985

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

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

6 months agoOverride the user's language settings during tests
mark@chromium.org [Wed, 11 Jun 2014 13:34:24 +0000 (13:34 +0000)]
Override the user's language settings during tests

If a user's language is set to anything other than English, the output
of various tools may vary from what is expected and cause tests to
fail. This fixes several test failures for non-English users.

To reproduce the issue, run: LC_ALL=de_DE.UTF-8 ./gyptest.py -a

Patch by Joey Parrish <joeyparrish@google.com>

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

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

6 months agoAdd unittest for 'AR' in 'make_global_settings'
yukawa@chromium.org [Mon, 9 Jun 2014 17:11:16 +0000 (17:11 +0000)]
Add unittest for 'AR' in 'make_global_settings'

Currently sharing the code among host/NaCl/NDK/Emscripten on top of Ninja+gyp isn't so easy as it should be because not all items in 'make_global_settings' are recognized by Ninja generator (gyp:434).

On the other hand, the current test coverage of 'make_global_settings' isn't so good. Thus this CL describes the current behavior with some unittests before making Ninja generator aware of 'AR' in 'make_global_settings' like Make generator.

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

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

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

6 months agoAdd option for link concurrency.
scottmg@chromium.org [Thu, 5 Jun 2014 22:32:23 +0000 (22:32 +0000)]
Add option for link concurrency.

Skia's buildbots, particularly Windows builds with LTO, are held back by the
link pool.  We'd like to play around with this number a bit.  Any problem
checking an environment variable first before doing the RAM-based calculation?

Testing: ran with and without GYP_LINK_CONCURRENCY=90, looked at build.ninja

Patch from mtklein@chromium.org.

R=scottmg@chromium.org

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

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

6 months agoFix msvs-ninja clean build command / target.
bungeman@chromium.org [Thu, 5 Jun 2014 18:26:16 +0000 (18:26 +0000)]
Fix msvs-ninja clean build command / target.

Currently the clean command is specified as

ninja.exe -C $(OutDir) -t clean $(ProjectName)

but _BuildCommandLineForRuleRaw sees 'clean' as a path, calling _FixPath on it.
This is not a problem for Chromium because it does not set --generator-output.
As a result fixpath_prefix is None and no adjustment is made to paths.
Skia, however, does set --generator-output, and so an attempt is made to adjust
paths with _FixPath. As a result, with Skia the msvs 'Clean' target contains

ninja.exe -C $(OutDir) -t ../../gyp/clean $(ProjectName)

This change changes the command to

ninja.exe -C $(OutDir) -tclean $(ProjectName)

which it valid for ninja, but _BuildCommandLineForRuleRaw will not _FixPath it.

BUG=skia:2439
R=sbaig1@bloomberg.net

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

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

6 months agogyp: use all processors instead of hard-coded 8.
mark@chromium.org [Thu, 5 Jun 2014 13:27:40 +0000 (13:27 +0000)]
gyp: use all processors instead of hard-coded 8.

Makes no difference for me but might help others because gyp can easily
keep lots of processors busy.

BUG=362075

Originally landed at r1896 and backed out at r1911. This should be safe
to land after r1913.

Patch by Daniel Bratell <bratell@opera.com>.

R=torne@chromium.org

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

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

6 months agoandroid: Handle inputs with spaces inside make functions.
torne@chromium.org [Wed, 4 Jun 2014 17:20:44 +0000 (17:20 +0000)]
android: Handle inputs with spaces inside make functions.

A chromium gyp rule for generating assembly offsets for libvpx/webrtc
needs to be able to refer to $(call ...) macros from the Android build
system internals in order to function, but the gyp backend currently
rejects input and output names that include spaces as a sanity check to
prevent make from misinterpreting a filename with whitespace as two
files.

Skip this check in the case where the input or output filename starts
with '$(' so that make macros are not rejected. Add two test cases: one
to check that normal filenames with spaces are forbidden, and one to
check that using a make macro as an input definitely works.

BUG=gyp:432
R=sbc@chromium.org

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

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

6 months agoFix msvs-ninja OutputDirectory path.
bungeman@chromium.org [Wed, 4 Jun 2014 16:07:15 +0000 (16:07 +0000)]
Fix msvs-ninja OutputDirectory path.

_FixPath is designed to take gyp paths and convert them to msvs project paths.
This translates a <gyp_dir>"<gyp_dir_to_X>" to
<msvs_project_dir>"<msvs_project_dir_to_gyp_dir>/<gyp_dir_to_X>".

The OutputDirectory when using ninja as the external builder with the ninja
generator generated build files needs to be the path
<msvs_project_dir>"<msvs_project_dir_to_ninja_build_config>".
Since this is specified on a per target basis and will be run though _FixPath,
the external builder directory in the target must be specified as
<gyp_dir>"<gyp_dir_to_toplevel_dir>/<toplevel_dir_to_ninja_build>/<config>".

Chromium currently does not see any issue as it does not set generator_output.
When generator_output is not set, _GetPathOfProject sets fix_prefix to None.
Also, Chromium appears to be using an absolute path for
msvs_external_builder_out_dir.

This is, however, affecting Skia, which sets generator_output to 'out' and
places all of its gyp files in a 'gyp' directory. As a result Skia is seeing
the OutputDirectory set to "../../gyp/out/$(Configuration)". This change fixes
this to "../../out/$(Configuration)".

R=scottmg@chromium.org

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

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

6 months agomsvs: Revert r1920 and add a test for excluded idl
sbaig1@bloomberg.net [Thu, 29 May 2014 19:15:27 +0000 (19:15 +0000)]
msvs: Revert r1920 and add a test for excluded idl

The test uses a "bad" idl to verify that it gets excluded from the msvs build.
If it doesn't get excluded, then the build will fail because the bad.idl is
syntactically wrong.

BUG=
R=scottmg@chromium.org

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

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

6 months agoUse relative path/dir msbuild variables to map $(InputDir) and $(InputPath)
scottmg@chromium.org [Wed, 28 May 2014 05:07:57 +0000 (05:07 +0000)]
Use relative path/dir msbuild variables to map $(InputDir) and $(InputPath)

$(InputDir) and $(InputPath) assume relative paths, but they're mapped to
%(RootDir)%(Directory) and %(FullPath) respectively. This makes gyp
generate incorrect commands for non-external rules in VS, for example:

-I ../foo/C:/bar/baz.h

(based on a generated command when building content_shell in VS)

MSBuild also provides variables for relative dir and path, so we should
use those instead to map $(InputDir) and $(InputPath).

Ran test/msvs and test/win test suites against VS2010 and VS2013, no regression.
Since VS maintains the cwd when building, using relative paths shouldn't affect
the current behavior. The only case where it might break things is if an
external script/command expects absolute paths for its arguments. I haven't
seen any instance of this while building content_shell and its dependencies.

BUG=

Patch from romain.pokrzywka@gmail.com.

R=scottmg@chromium.org

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

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

6 months agoFix for some rules not being run if their trigger is also an action dependency
scottmg@chromium.org [Tue, 27 May 2014 21:34:04 +0000 (21:34 +0000)]
Fix for some rules not being run if their trigger is also an action dependency

The issue happens with e.g. accessibility.gyp for the ax_gen target:
Because ax_enums.idl is also an action additional input, it gets added to the
excluded_sources list when gyp generates the project, so the genapi_idl rule
on ax_enums.idl is marked as excluded from the build.

Rule target files should be removed from the excluded_sources list to
allow their rule to be run.

BUG=

R=scottmg@chromium.org

Patch from romain.pokrzywka@gmail.com.

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

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

6 months agoninja win: filter 64 bit idl processing, and confirm in test
scottmg@chromium.org [Wed, 21 May 2014 20:12:49 +0000 (20:12 +0000)]
ninja win: filter 64 bit idl processing, and confirm in test

Windows x64 build otherwise emits noise like:

"
64 bit Processing ..\..\third_party\iaccessible2\ia2_api_all.idl

ia2_api_all.idl
"

Suppress that, and confirm in existing test.

R=thakis@chromium.org

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

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

6 months agoFix link step when specifying CLANG_CXX_LIBRARY
sdefresne@chromium.org [Mon, 19 May 2014 17:58:10 +0000 (17:58 +0000)]
Fix link step when specifying CLANG_CXX_LIBRARY

When using C++ library, pass the -stdlib flag to the linker so that the
correct library is linked against the binary.

The test allocate a string on the stack in order to check that the correct
library is linked. This is sufficient since libc++ and libstdc++ have an
incompatible ABI and linking fails if compilation and link does not use the
same value for -stdlib flag.

For example, if using -stdlib=libc++ when compiling and -stdlib=libstdc++
when linking the test program result in the following compilation error:

FAILED: /usr/bin/clang++ -mmacosx-version-min=10.7 -arch x86_64 -L. -o libc++ obj/libc++.libc++.o
Undefined symbols for architecture x86_64:
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()", referenced from:
      _main in libc++.libc++.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

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

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

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

7 months agoDon't exclude sources for 'none' targets
sbaig1@bloomberg.net [Wed, 14 May 2014 13:17:37 +0000 (13:17 +0000)]
Don't exclude sources for 'none' targets

MSVS doesn't compile files for 'none' targets, so there is no need to "exclude"
them.

BUG=
R=scottmg@chromium.org

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

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

7 months agoninja/mac: Update libtool noise filter for Xcode 5.
thakis@chromium.org [Tue, 13 May 2014 09:17:23 +0000 (09:17 +0000)]
ninja/mac: Update libtool noise filter for Xcode 5.

BUG=chromium:372716
R=senorblanco@chromium.org

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

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

7 months agoandroid: set GYP_VAR_PREFIX as a local variable in actions/rules.
torne@chromium.org [Thu, 8 May 2014 09:33:53 +0000 (09:33 +0000)]
android: set GYP_VAR_PREFIX as a local variable in actions/rules.

A few actions/rules need to be able to call the intermediates-dir-for
function from the Android build system in order to discover the location
of another target's intermediates. To do this correctly in a multilib
build we need to pass GYP_VAR_PREFIX to pick the right intermediate
location, but since the variable is not expanded until the command is
executed we need to set a rule-specific local variable for this purpose,
as otherwise it will use whichever value of GYP_VAR_PREFIX was set last
instead of the value for the current target.

This is the same pattern used for other target-specific variables such
as LOCAL_PATH.

BUG=
R=thakis@chromium.org

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

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

7 months agoRemove pylintrc and enable pylint checks for the Xcode generator.
mark@chromium.org [Tue, 6 May 2014 16:56:23 +0000 (16:56 +0000)]
Remove pylintrc and enable pylint checks for the Xcode generator.

This copy of pylintrc is never used, and its presence is confusing. The
canned pylint check uses the pylintrc in depot_tools. Project-specific
blacklisted and whitelisted files and disabled warnings are enumerated
in PRESUBMIT.py.

xcode.py is pylint-clean with the current pylint configuration, so it no
longer needs to be excluded from pylint checks.

TEST=presubmit
R=thakis@chromium.org

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

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

7 months agoPrefer MSVS 2013 over MSVS 2010
sbaig1@bloomberg.net [Tue, 6 May 2014 16:52:11 +0000 (16:52 +0000)]
Prefer MSVS 2013 over MSVS 2010

BUG=
R=scottmg@chromium.org

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

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

7 months agoSilence pylint for the imported OrderedSet class.
mark@chromium.org [Tue, 6 May 2014 16:39:25 +0000 (16:39 +0000)]
Silence pylint for the imported OrderedSet class.

Silence two warnings:
OrderedSet.discard: Redefining built-in 'next'
OrderedSet.pop: Arguments number differs from overridden method

Patch by Daniel Bratell <bratell@opera.com>

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

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

7 months agoAdd xcode_ninja_target_pattern to xcode-ninja generator
justincohen@chromium.org [Tue, 6 May 2014 16:21:14 +0000 (16:21 +0000)]
Add xcode_ninja_target_pattern to xcode-ninja generator

Adds new GYP_GENERATOR_FLAG xcode_ninja_target_pattern. This
customization allows for non-executable targets in the xcode_ninja wrapper.

Also changes the name of xcode_ninja_target_filter to
xcode_ninja_executable_target_pattern.

xcode_ninja_executable_target_pattern (default all)
  - Restrict executable targets to this pattern, if set.
xcode_ninja_target_pattern (default none)
  - Include extra targets, such as non-executable targets based on this pattern, if set.

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

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

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