OLD | NEW |
| (Empty) |
1 # ============================================================================= | |
2 # BUILD FLAGS | |
3 # ============================================================================= | |
4 # | |
5 # This block lists input arguments to the build, along with their default | |
6 # values. GN requires listing them explicitly so it can validate input and have | |
7 # a central place to manage the build flags. | |
8 # | |
9 # If a value is specified on the command line, it will overwrite the defaults | |
10 # given here, otherwise the default will be injected into the root scope. | |
11 # | |
12 # KEEP IN ALPHABETICAL ORDER and write a good description for everything. | |
13 # Use "is_*" names for intrinsic platform descriptions and build modes, and | |
14 # "use_*" names for optional features libraries, and configurations. | |
15 declare_args() { | |
16 is_component_build = 1 | |
17 is_chromeos = 0 | |
18 is_debug = 1 | |
19 use_ash = 0 | |
20 use_aura = 0 | |
21 use_ozone = 0 | |
22 } | |
23 | |
24 # ============================================================================= | |
25 # SOURCES FILTERS | |
26 # ============================================================================= | |
27 # | |
28 # These patterns filter out platform-specific files when assigning to the | |
29 # sources variable. The magic variable |sources_assignment_filter| is applied | |
30 # to each assignment or appending to the sources variable and matches are | |
31 # automatcally removed. | |
32 # | |
33 # We define lists of filters for each platform for all builds so they can | |
34 # be used by individual targets if necessary (a target can always change | |
35 # sources_assignment_filter on itself if it needs something more specific). | |
36 # | |
37 # Note that the patterns are NOT regular expressions. Only "*" and "\b" (path | |
38 # boundary = end of string or slash) are supported, and the entire string | |
39 # muct match the pattern (so you need "*.cc" to match all .cc files, for | |
40 # example). | |
41 | |
42 windows_sources_filters = [ | |
43 "*_win.cc", | |
44 "*_win.h", | |
45 "*_win_unittest.cc", | |
46 "*\bwin/*", | |
47 ] | |
48 mac_sources_filters = [ | |
49 "*_mac.h", | |
50 "*_mac.cc", | |
51 "*_mac.mm", | |
52 "*_mac_unittest.h", | |
53 "*_mac_unittest.cc", | |
54 "*_mac_unittest.mm", | |
55 "*\bmac/*", | |
56 "*_cocoa.h", | |
57 "*_cocoa.cc", | |
58 "*_cocoa.mm", | |
59 "*_cocoa_unittest.h", | |
60 "*_cocoa_unittest.cc", | |
61 "*_cocoa_unittest.mm", | |
62 "*\bcocoa/*", | |
63 ] | |
64 ios_sources_filters = [ | |
65 "*_ios.h", | |
66 "*_ios.cc", | |
67 "*_ios.mm", | |
68 "*_ios_unittest.h", | |
69 "*_ios_unittest.cc", | |
70 "*_ios_unittest.mm", | |
71 "*\bios/*", | |
72 ] | |
73 objective_c_sources_filters = [ | |
74 "*.mm", | |
75 ] | |
76 linux_sources_filters = [ | |
77 "*_linux.h", | |
78 "*_linux.cc", | |
79 "*_linux_unittest.h", | |
80 "*_linux_unittest.cc", | |
81 "*\blinux/*", | |
82 ] | |
83 android_sources_filters = [ | |
84 "*_android.h", | |
85 "*_android.cc", | |
86 "*_android_unittest.h", | |
87 "*_android_unittest.cc", | |
88 "*\bandroid/*", | |
89 ] | |
90 posix_sources_filters = [ | |
91 "*_posix.h", | |
92 "*_posix.cc", | |
93 "*_posix_unittest.h", | |
94 "*_posix_unittest.cc", | |
95 "*\bposix/*", | |
96 ] | |
97 | |
98 # Construct the full list of sources we're using for this platform. | |
99 sources_assignment_filter = [] | |
100 if (is_win) { | |
101 sources_assignment_filter += posix_sources_filters | |
102 } else { | |
103 sources_assignment_filter += windows_sources_filters | |
104 } | |
105 if (!is_mac) { | |
106 sources_assignment_filter += mac_sources_filters | |
107 } | |
108 if (!is_ios) { | |
109 sources_assignment_filter += ios_sources_filters | |
110 } | |
111 if (!is_mac && !is_ios) { | |
112 sources_assignment_filter += objective_c_sources_filters | |
113 } | |
114 if (!is_linux) { | |
115 sources_assignment_filter += linux_sources_filters | |
116 } | |
117 if (!is_android) { | |
118 sources_assignment_filter += android_sources_filters | |
119 } | |
120 | |
121 # This is the actual set. | |
122 set_sources_assignment_filter(sources_assignment_filter) | |
123 | |
124 # ============================================================================= | |
125 # SYSTEM CONFIG | |
126 # ============================================================================= | |
127 | |
128 is_nacl = 0 | |
129 | |
130 # ============================================================================= | |
131 # BUILD OPTIONS | |
132 # ============================================================================= | |
133 | |
134 if (is_component_build) { | |
135 component_mode = "shared_library" | |
136 } else { | |
137 component_mode = "static_library" | |
138 } | |
139 | |
140 # ============================================================================= | |
141 # TARGET DEFAULTS | |
142 # ============================================================================= | |
143 # | |
144 # Set up the default configuration for every build target of the given type. | |
145 # The values configured here will be automatically set on the scope of the | |
146 # corresponding target. Target definitions can add or remove to the settings | |
147 # here as needed. | |
148 | |
149 # Holds all configs used for making native executables and libraries, to avoid | |
150 # duplication in each target below. | |
151 native_compiler_configs = [ | |
152 "//build/config:my_msvs", # TODO(brettw) eraseme | |
153 | |
154 "//build/config/compiler:chromium_code", | |
155 "//build/config/compiler:disable_annoying_warnings", | |
156 "//build/config/compiler:no_rtti", | |
157 "//build/config/compiler:runtime_library", | |
158 ] | |
159 if (is_win) { | |
160 native_compiler_configs += "//build/config/win:sdk" | |
161 } | |
162 | |
163 if (is_debug) { | |
164 native_compiler_configs += "//build/config:debug" | |
165 } else { | |
166 native_compiler_configs += "//build/config::release" | |
167 } | |
168 | |
169 set_defaults("executable") { | |
170 configs = native_compiler_configs | |
171 } | |
172 | |
173 set_defaults("static_library") { | |
174 configs = native_compiler_configs | |
175 } | |
176 | |
177 set_defaults("shared_library") { | |
178 configs = native_compiler_configs | |
179 } | |
180 | |
181 # ============================================================================== | |
182 # TOOLCHAIN SETUP | |
183 # ============================================================================== | |
184 | |
185 if (is_win) { | |
186 set_default_toolchain("//build/config/win:32") | |
187 } | |
OLD | NEW |