diff options
author | bradnelson@google.com <bradnelson@google.com@78cadc50-ecff-11dd-a971-7dbc132099af> | 2009-10-21 22:40:34 +0000 |
---|---|---|
committer | bradnelson@google.com <bradnelson@google.com@78cadc50-ecff-11dd-a971-7dbc132099af> | 2009-10-21 22:40:34 +0000 |
commit | 3aebc0b95cda686fe72b3fb77f7e5200e0e3ee78 (patch) | |
tree | 22a2fc9f9ae4c6e8e4999c6d5769c9652ad789af | |
parent | b58da7bba84dec4311b0a831ddeba071a50b10e4 (diff) | |
download | gyp-3aebc0b95cda686fe72b3fb77f7e5200e0e3ee78.tar.gz |
Fixing make generator to be able to handle targets with no output.
Adding a test to catch this kind of failure in the future.
BUG=None
TEST=None
Review URL: http://codereview.chromium.org/307028
git-svn-id: http://gyp.googlecode.com/svn/trunk@719 78cadc50-ecff-11dd-a971-7dbc132099af
-rw-r--r-- | pylib/gyp/generator/make.py | 7 | ||||
-rw-r--r-- | test/actions-bare/gyptest-bare.py | 2 | ||||
-rw-r--r-- | test/no-output/gyptest-no-output.py | 15 | ||||
-rw-r--r-- | test/no-output/src/nooutput.gyp | 13 |
4 files changed, 33 insertions, 4 deletions
diff --git a/pylib/gyp/generator/make.py b/pylib/gyp/generator/make.py index f0a23ffa..fda0af81 100644 --- a/pylib/gyp/generator/make.py +++ b/pylib/gyp/generator/make.py @@ -743,9 +743,10 @@ class MakefileWriter: else: print "WARNING: no output for", self.type, target - # Add an alias for each target. - self.WriteMakeRule([self.target], [self.output], - comment='Add target alias') + # Add an alias for each target (if there are any outputs). + if self.output: + self.WriteMakeRule([self.target], [self.output], + comment='Add target alias') # Add special-case rules for our installable targets. # 1) They need to install to the build dir or "product" dir. diff --git a/test/actions-bare/gyptest-bare.py b/test/actions-bare/gyptest-bare.py index eab6d2a1..a8c441c2 100644 --- a/test/actions-bare/gyptest-bare.py +++ b/test/actions-bare/gyptest-bare.py @@ -1,7 +1,7 @@ #!/usr/bin/env python """ -Verifies simple actions when using an explicit build target of 'all'. +Verifies actions which are not depended on by other targets get executed. """ import TestGyp diff --git a/test/no-output/gyptest-no-output.py b/test/no-output/gyptest-no-output.py new file mode 100644 index 00000000..b06f7a49 --- /dev/null +++ b/test/no-output/gyptest-no-output.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python + +""" +Verified things don't explode when there are targets without outputs. +""" + +import TestGyp + +test = TestGyp.TestGyp() + +test.run_gyp('nooutput.gyp', chdir='src') +test.relocate('src', 'relocate/src') +test.build('nooutput.gyp', chdir='relocate/src') + +test.pass_test() diff --git a/test/no-output/src/nooutput.gyp b/test/no-output/src/nooutput.gyp new file mode 100644 index 00000000..c0bd3980 --- /dev/null +++ b/test/no-output/src/nooutput.gyp @@ -0,0 +1,13 @@ +{ + 'targets': [ + { + 'target_name': 'no_output', + 'type': 'none', + 'direct_dependent_settings': { + 'defines': [ + 'NADA', + ], + }, + }, + ], +} |