Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Side by Side Diff: build/config/mac/BUILD.gn

Issue 2160653002: [iOS/GN] Fix generation of .dSYM for fat binary builds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and add support for save_unstripped_output. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « build/config/ios/rules.gni ('k') | build/config/mac/base_rules.gni » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/ios/ios_sdk.gni")
6 import("//build/config/mac/mac_sdk.gni") 7 import("//build/config/mac/mac_sdk.gni")
7 import("//build/config/mac/symbols.gni") 8 import("//build/config/mac/symbols.gni")
8 9
9 # This is included by reference in the //build/config/compiler config that 10 # This is included by reference in the //build/config/compiler config that
10 # is applied to all targets. It is here to separate out the logic. 11 # is applied to all targets. It is here to separate out the logic.
11 # 12 #
12 # This is applied to BOTH desktop Mac and iOS targets. 13 # This is applied to BOTH desktop Mac and iOS targets.
13 config("compiler") { 14 config("compiler") {
14 # These flags are shared between the C compiler and linker. 15 # These flags are shared between the C compiler and linker.
15 common_mac_flags = [] 16 common_mac_flags = []
(...skipping 26 matching lines...) Expand all
42 43
43 # Without this, the constructors and destructors of a C++ object inside 44 # Without this, the constructors and destructors of a C++ object inside
44 # an Objective C struct won't be called, which is very bad. 45 # an Objective C struct won't be called, which is very bad.
45 cflags_objcc = [ "-fobjc-call-cxx-cdtors" ] 46 cflags_objcc = [ "-fobjc-call-cxx-cdtors" ]
46 47
47 cflags_c = [ "-std=c99" ] 48 cflags_c = [ "-std=c99" ]
48 cflags_objc = cflags_c 49 cflags_objc = cflags_c
49 50
50 ldflags = common_mac_flags 51 ldflags = common_mac_flags
51 52
52 if (save_unstripped_output) { 53 if (is_ios && additional_toolchains != []) {
54 # For fat build, the generation of the dSYM happens after the fat binary has
55 # been created with "lipo" thus the stripping cannot happen at link time but
56 # after running "lipo" too.
57 _save_unstripped_output = false
58 } else {
59 _save_unstripped_output = save_unstripped_output
60 }
61
62 if (_save_unstripped_output) {
53 ldflags += [ "-Wcrl,unstripped," + rebase_path(root_out_dir) ] 63 ldflags += [ "-Wcrl,unstripped," + rebase_path(root_out_dir) ]
54 } 64 }
55 } 65 }
56 66
57 # This is included by reference in the //build/config/compiler:runtime_library 67 # This is included by reference in the //build/config/compiler:runtime_library
58 # config that is applied to all targets. It is here to separate out the logic 68 # config that is applied to all targets. It is here to separate out the logic
59 # that is Mac-only. Please see that target for advice on what should go in 69 # that is Mac-only. Please see that target for advice on what should go in
60 # :runtime_library vs. :compiler. 70 # :runtime_library vs. :compiler.
61 config("runtime_library") { 71 config("runtime_library") {
62 common_flags = [ 72 common_flags = [
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 ldflags = [ "-Wl,-pie" ] # Position independent. 110 ldflags = [ "-Wl,-pie" ] # Position independent.
101 } 111 }
102 112
103 # The ldflags referenced below are handled by 113 # The ldflags referenced below are handled by
104 # //build/toolchain/mac/linker_driver.py. 114 # //build/toolchain/mac/linker_driver.py.
105 # Remove this config if a target wishes to change the arguments passed to the 115 # Remove this config if a target wishes to change the arguments passed to the
106 # strip command during linking. This config by default strips all symbols 116 # strip command during linking. This config by default strips all symbols
107 # from a binary, but some targets may wish to specify a saves file to preserve 117 # from a binary, but some targets may wish to specify a saves file to preserve
108 # specific symbols. 118 # specific symbols.
109 config("strip_all") { 119 config("strip_all") {
110 if (enable_stripping) { 120 if (is_ios && additional_toolchains != []) {
121 # For fat build, the generation of the dSYM happens after the fat binary has
122 # been created with "lipo" thus the stripping cannot happen at link time but
123 # after running "lipo" too.
124 _enable_stripping = false
125 } else {
126 _enable_stripping = enable_stripping
127 }
128
129 if (_enable_stripping) {
111 ldflags = [ "-Wcrl,strip,-x,-S" ] 130 ldflags = [ "-Wcrl,strip,-x,-S" ]
112 } 131 }
113 } 132 }
OLDNEW
« no previous file with comments | « build/config/ios/rules.gni ('k') | build/config/mac/base_rules.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698