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 import("//build/config/sysroot.gni") | 5 import("//build/config/sysroot.gni") |
6 import("//build/config/mac/mac_sdk.gni") | 6 import("//build/config/mac/mac_sdk.gni") |
7 | 7 |
8 # This is included by reference in the //build/config/compiler config that | 8 # This is included by reference in the //build/config/compiler config that |
9 # is applied to all targets. It is here to separate out the logic. | 9 # is applied to all targets. It is here to separate out the logic. |
10 # | 10 # |
11 # This is applied to BOTH desktop Mac and iOS targets. | 11 # This is applied to BOTH desktop Mac and iOS targets. |
12 config("compiler") { | 12 config("compiler") { |
13 # These flags are shared between the C compiler and linker. | 13 # These flags are shared between the C compiler and linker. |
14 common_mac_flags = [] | 14 common_mac_flags = [] |
15 | 15 |
16 # CPU architecture. | 16 # CPU architecture. |
17 if (current_cpu == "x64") { | 17 if (current_cpu == "x64") { |
18 common_mac_flags += [ | 18 common_mac_flags += [ |
19 "-arch", | 19 "-arch", |
20 "x86_64", | 20 "x86_64", |
21 ] | 21 ] |
22 } else if (current_cpu == "x86") { | 22 } else if (current_cpu == "x86") { |
23 common_mac_flags += [ | 23 common_mac_flags += [ |
24 "-arch", | 24 "-arch", |
25 "i386", | 25 "i386", |
26 ] | 26 ] |
27 } else if (current_cpu == "arm") { | 27 } else if (current_cpu == "armv7" || current_cpu == "arm") { |
28 # TODO(GYP): we may need to distinguish between "arm64", "armv7", | 28 common_mac_flags += [ |
29 # and "armv7s" for iOS, and hence need multiple current_cpu values | 29 "-arch", |
30 # rather than just "arm". | 30 "armv7", |
| 31 ] |
| 32 } else if (current_cpu == "arm64") { |
31 common_mac_flags += [ | 33 common_mac_flags += [ |
32 "-arch", | 34 "-arch", |
33 "arm64", | 35 "arm64", |
34 "-arch", | |
35 "armv7", | |
36 ] | 36 ] |
37 } | 37 } |
38 | 38 |
39 asmflags = common_mac_flags | 39 asmflags = common_mac_flags |
40 cflags = common_mac_flags | 40 cflags = common_mac_flags |
41 | 41 |
42 # Without this, the constructors and destructors of a C++ object inside | 42 # Without this, the constructors and destructors of a C++ object inside |
43 # an Objective C struct won't be called, which is very bad. | 43 # an Objective C struct won't be called, which is very bad. |
44 cflags_objcc = [ "-fobjc-call-cxx-cdtors" ] | 44 cflags_objcc = [ "-fobjc-call-cxx-cdtors" ] |
45 | 45 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 "-Wl,-rpath,@loader_path/../../..", | 79 "-Wl,-rpath,@loader_path/../../..", |
80 ] | 80 ] |
81 } | 81 } |
82 } | 82 } |
83 | 83 |
84 # On Mac, this is used only for executables. | 84 # On Mac, this is used only for executables. |
85 config("mac_executable_flags") { | 85 config("mac_executable_flags") { |
86 # Remove this when targeting >=10.7 since it is the default in that config. | 86 # Remove this when targeting >=10.7 since it is the default in that config. |
87 ldflags = [ "-Wl,-pie" ] # Position independent. | 87 ldflags = [ "-Wl,-pie" ] # Position independent. |
88 } | 88 } |
OLD | NEW |