OLD | NEW |
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 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 # ============================================================================= | 5 # ============================================================================= |
6 # BUILD FLAGS | 6 # BUILD FLAGS |
7 # ============================================================================= | 7 # ============================================================================= |
8 # | 8 # |
9 # This block lists input arguments to the build, along with their default | 9 # This block lists input arguments to the build, along with their default |
10 # values. GN requires listing them explicitly so it can validate input and have | 10 # values. GN requires listing them explicitly so it can validate input and have |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 # OS DEFINITIONS | 90 # OS DEFINITIONS |
91 # ============================================================================= | 91 # ============================================================================= |
92 # | 92 # |
93 # We set these various is_FOO booleans for convenience in writing OS-based | 93 # We set these various is_FOO booleans for convenience in writing OS-based |
94 # conditions. | 94 # conditions. |
95 # | 95 # |
96 # - is_android, is_chromeos, is_ios, and is_win should be obvious. | 96 # - is_android, is_chromeos, is_ios, and is_win should be obvious. |
97 # - is_mac is set only for desktop Mac. It is not set on iOS. | 97 # - is_mac is set only for desktop Mac. It is not set on iOS. |
98 # - is_posix is true for mac and any Unix-like system (basically everything | 98 # - is_posix is true for mac and any Unix-like system (basically everything |
99 # except Windows). | 99 # except Windows). |
100 # - is_linux is true for any Linux variant including Android and ChromeOS. | 100 # - is_linux is true for desktop Linux and ChromeOS, but not Android (which is |
| 101 # generally too different despite being based on the Linux kernel). |
101 # | 102 # |
102 # Do not add more is_* variants here for random lesser-used Unix systems like | 103 # Do not add more is_* variants here for random lesser-used Unix systems like |
103 # aix or one of the BSDs. If you need to check these, just check the os value | 104 # aix or one of the BSDs. If you need to check these, just check the os value |
104 # directly. | 105 # directly. |
105 | 106 |
106 if (os == "win") { | 107 if (os == "win") { |
107 is_android = false | 108 is_android = false |
108 is_chromeos = false | 109 is_chromeos = false |
109 is_ios = false | 110 is_ios = false |
110 is_linux = false | 111 is_linux = false |
(...skipping 13 matching lines...) Expand all Loading... |
124 is_nacl = false | 125 is_nacl = false |
125 is_posix = true | 126 is_posix = true |
126 is_win = false | 127 is_win = false |
127 if (!is_clang) { | 128 if (!is_clang) { |
128 is_clang = true # Always use clang on Mac. | 129 is_clang = true # Always use clang on Mac. |
129 } | 130 } |
130 } else if (os == "android") { | 131 } else if (os == "android") { |
131 is_android = true | 132 is_android = true |
132 is_chromeos = false | 133 is_chromeos = false |
133 is_ios = false | 134 is_ios = false |
134 is_linux = true | 135 is_linux = false |
135 is_mac = false | 136 is_mac = false |
136 is_nacl = false | 137 is_nacl = false |
137 is_posix = true | 138 is_posix = true |
138 is_win = false | 139 is_win = false |
139 } else if (os == "chromeos") { | 140 } else if (os == "chromeos") { |
140 is_android = false | 141 is_android = false |
141 is_chromeos = true | 142 is_chromeos = true |
142 is_ios = false | 143 is_ios = false |
143 is_linux = true | 144 is_linux = true |
144 is_mac = false | 145 is_mac = false |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 "//build/config/win:console", | 394 "//build/config/win:console", |
394 ] | 395 ] |
395 } | 396 } |
396 | 397 |
397 set_defaults("executable") { | 398 set_defaults("executable") { |
398 configs = native_compiler_configs | 399 configs = native_compiler_configs |
399 if (is_win) { | 400 if (is_win) { |
400 configs += windows_linker_configs | 401 configs += windows_linker_configs |
401 } else if (is_mac) { | 402 } else if (is_mac) { |
402 configs += [ "//build/config/mac:mac_dynamic_flags" ] | 403 configs += [ "//build/config/mac:mac_dynamic_flags" ] |
403 } else if (is_linux) { | 404 } else if (is_linux || is_android) { |
404 configs += [ "//build/config/linux:executable_ldconfig" ] | 405 configs += [ "//build/config/linux:executable_ldconfig" ] |
405 } | 406 } |
406 } | 407 } |
407 | 408 |
408 set_defaults("static_library") { | 409 set_defaults("static_library") { |
409 configs = native_compiler_configs | 410 configs = native_compiler_configs |
410 } | 411 } |
411 | 412 |
412 set_defaults("shared_library") { | 413 set_defaults("shared_library") { |
413 configs = native_compiler_configs | 414 configs = native_compiler_configs |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 } else if (is_android) { | 449 } else if (is_android) { |
449 host_toolchain = "//build/toolchain/linux:$build_cpu_arch" | 450 host_toolchain = "//build/toolchain/linux:$build_cpu_arch" |
450 set_default_toolchain("//build/toolchain/android:$cpu_arch") | 451 set_default_toolchain("//build/toolchain/android:$cpu_arch") |
451 } else if (is_linux) { | 452 } else if (is_linux) { |
452 host_toolchain = "//build/toolchain/linux:$build_cpu_arch" | 453 host_toolchain = "//build/toolchain/linux:$build_cpu_arch" |
453 set_default_toolchain("//build/toolchain/linux:$cpu_arch") | 454 set_default_toolchain("//build/toolchain/linux:$cpu_arch") |
454 } else if (is_mac || is_ios) { | 455 } else if (is_mac || is_ios) { |
455 host_toolchain = "//build/toolchain/mac:clang" | 456 host_toolchain = "//build/toolchain/mac:clang" |
456 set_default_toolchain(host_toolchain) | 457 set_default_toolchain(host_toolchain) |
457 } | 458 } |
OLD | NEW |