Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for building targets directly from gyp.
A new --build option has been added which can be used to build configurations directly from gyp. Each generator has a new method (PerformBuild) which knows how to invoke the underlying build environment to build a certain configuration. e.g. $ gyp hello.gyp --format=ninja --build=Default This allows gyp call sites to do actual builds without having to know the exact method for running the underlying build environment. The motivation here is to remove the complexity and duplication involved with building from gyp. Currently there are several places where gyp is run and then the underlying build is run right away in all cases. (e.g the Gyp tests, the buildbots). NaCl and the NaCL SDK are also about to add two more places where this is desirable. Rational for putting this logic in the generators themselves is that the generator maintainer is best placed to know how to invoke the build. Also the details of how to run Foo seem best placed in the Foo generator (especially if you think of generators as plugins for gyp). BUG= Review URL: https://chromiumcodereview.appspot.com/10909158 git-svn-id: http://gyp.googlecode.com/svn/trunk@1499 78cadc50-ecff-11dd-a971-7dbc132099af
- Loading branch information
sbc@chromium.org
committed
Sep 18, 2012
1 parent
6cf3fba
commit 08fc464
Showing
12 changed files
with
170 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env python | ||
|
||
# Copyright (c) 2012 Google Inc. All rights reserved. | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
""" | ||
Verifies simplest-possible build of a "Hello, world!" program | ||
using the default build target. | ||
""" | ||
|
||
import TestGyp | ||
|
||
test = TestGyp.TestGyp(workdir='workarea_default') | ||
|
||
test.run_gyp('hello.gyp', '--build=Default') | ||
|
||
test.run_built_executable('hello', stdout="Hello, world!\n") | ||
|
||
test.up_to_date('hello.gyp', test.DEFAULT) | ||
|
||
test.pass_test() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* Copyright (c) 2012 Google Inc. All rights reserved. | ||
* Use of this source code is governed by a BSD-style license that can be | ||
* found in the LICENSE file. | ||
*/ | ||
|
||
#include <stdio.h> | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
printf("Hello, world!\n"); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Copyright (c) 2009 Google Inc. All rights reserved. | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
{ | ||
'targets': [ | ||
{ | ||
'target_name': 'hello', | ||
'type': 'executable', | ||
'sources': [ | ||
'hello.c', | ||
], | ||
}, | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters