|
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
|
2 # Use of this source code is governed by a BSD-style license that can be |
|
3 # found in the LICENSE file. |
|
4 |
|
5 # Xcode throws an error if an iOS target depends on a Mac OS X target. So |
|
6 # any place a utility program needs to be build and run, an action is |
|
7 # used to run ninja as script to work around this. |
|
8 # Example: |
|
9 # { |
|
10 # 'target_name': 'foo', |
|
11 # 'type': 'none', |
|
12 # 'variables': { |
|
13 # # The name of a directory used for ninja. This cannot be shared with |
|
14 # # another mac build. |
|
15 # 'ninja_output_dir': 'ninja-foo', |
|
16 # # The list of all the gyp files that contain the targets to run. |
|
17 # 're_run_targets': [ |
|
18 # 'foo.gyp', |
|
19 # ], |
|
20 # }, |
|
21 # 'includes': ['path_to/mac_build.gypi'], |
|
22 # 'actions': [ |
|
23 # { |
|
24 # 'action_name': 'compile foo', |
|
25 # 'inputs': [], |
|
26 # 'outputs': [], |
|
27 # 'action': [ |
|
28 # '<@(ninja_cmd)', |
|
29 # # All the targets to build. |
|
30 # 'foo1', |
|
31 # 'foo2', |
|
32 # ], |
|
33 # }, |
|
34 # ], |
|
35 # } |
|
36 { |
|
37 'variables': { |
|
38 # Convenience variable pointing to the ninja product directory. |
|
39 'ninja_product_dir': |
|
40 '<(DEPTH)/xcodebuild/<(ninja_output_dir)/<(CONFIGURATION_NAME)', |
|
41 |
|
42 # Common ninja command line flags. |
|
43 'ninja_cmd': [ |
|
44 # Bounce through clean_env to clean up the environment so things |
|
45 # set by the iOS build don't pollute the Mac build. |
|
46 '<(DEPTH)/build/ios/clean_env.py', |
|
47 # ninja must be found in the PATH. |
|
48 'ADD_TO_PATH=<!(echo $PATH)', |
|
49 'ninja', |
|
50 '-C', |
|
51 '<(ninja_product_dir)', |
|
52 ], |
|
53 |
|
54 # Common syntax to rerun gyp to generate the Mac projects. |
|
55 're_run_gyp': [ |
|
56 'build/gyp_chromium', |
|
57 # Don't use anything set for the iOS side of things. |
|
58 '--ignore-environment', |
|
59 # Generate for ninja |
|
60 '--format=ninja', |
|
61 # Generate files into xcodebuild/ninja |
|
62 '-Goutput_dir=xcodebuild/<(ninja_output_dir)', |
|
63 # nacl isn't in the iOS checkout, make sure it's turned off |
|
64 '-Ddisable_nacl=1', |
|
65 # Add a variable to handle specific cases for mac_build. |
|
66 '-Dios_mac_build=1', |
|
67 # Pass through the Mac SDK version. |
|
68 '-Dmac_sdk=<(mac_sdk)', |
|
69 ], |
|
70 |
|
71 # Rerun gyp for each of the projects needed. This is what actually |
|
72 # generates the projects on disk. |
|
73 're_run_gyp_execution': |
|
74 '<!(cd <(DEPTH) && <@(re_run_gyp) <@(re_run_targets))', |
|
75 }, |
|
76 # Since these are used to generate things needed by other targets, make |
|
77 # them hard dependencies so they are always built first. |
|
78 'hard_dependency': 1, |
|
79 } |