| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """A module to add gyp support to cr.""" | 5 """A module to add gyp support to cr.""" |
| 6 | 6 |
| 7 import cr | 7 import cr |
| 8 | 8 |
| 9 | 9 |
| 10 class GypPrepareOut(cr.PrepareOut): | 10 class GypPrepareOut(cr.PrepareOut): |
| 11 """A prepare action that runs gyp whenever you select an output directory.""" | 11 """A prepare action that runs gyp whenever you select an output directory.""" |
| 12 | 12 |
| 13 ENABLED = cr.Config.From( | 13 ENABLED = cr.Config.From( |
| 14 GYP_GENERATORS='ninja', | 14 GYP_GENERATORS='ninja', |
| 15 GYP_GENERATOR_FLAGS='output_dir={CR_OUT_BASE} config={CR_BUILDTYPE}', | 15 GYP_GENERATOR_FLAGS='output_dir={CR_OUT_BASE} config={CR_BUILDTYPE}', |
| 16 ) | 16 ) |
| 17 | 17 |
| 18 def Prepare(self, context): | 18 def Prepare(self): |
| 19 if context.verbose >= 1: | 19 if cr.context.verbose >= 1: |
| 20 print context.Substitute('Invoking gyp with {GYP_GENERATOR_FLAGS}') | 20 print cr.context.Substitute('Invoking gyp with {GYP_GENERATOR_FLAGS}') |
| 21 cr.Host.Execute( | 21 cr.Host.Execute( |
| 22 context, | |
| 23 '{CR_SRC}/build/gyp_chromium', | 22 '{CR_SRC}/build/gyp_chromium', |
| 24 '--depth={CR_SRC}', | 23 '--depth={CR_SRC}', |
| 25 '--check' | 24 '--check' |
| 26 ) | 25 ) |
| OLD | NEW |