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

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

Issue 1961473003: [Mac/GN] Set up the component build. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
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 # TODO(brettw) Use "gcc_toolchain.gni" like the Linux toolchains. This requires 5 # TODO(brettw) Use "gcc_toolchain.gni" like the Linux toolchains. This requires
6 # some enhancements since the commands on Mac are slightly different than on 6 # some enhancements since the commands on Mac are slightly different than on
7 # Linux. 7 # Linux.
8 8
9 import("../goma.gni") 9 import("../goma.gni")
10 import("//build/config/ios/ios_sdk.gni") 10 import("//build/config/ios/ios_sdk.gni")
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 # the existing .TOC file, overwrite it, otherwise, don't change it. 131 # the existing .TOC file, overwrite it, otherwise, don't change it.
132 # 132 #
133 # As a special case, if the library reexports symbols from other dynamic 133 # As a special case, if the library reexports symbols from other dynamic
134 # libraries, we always update the .TOC and skip the temporary file and 134 # libraries, we always update the .TOC and skip the temporary file and
135 # diffing steps, since that library always needs to be re-linked. 135 # diffing steps, since that library always needs to be re-linked.
136 tocname = dylib + ".TOC" 136 tocname = dylib + ".TOC"
137 temporary_tocname = dylib + ".tmp" 137 temporary_tocname = dylib + ".tmp"
138 138
139 does_reexport_command = "[ ! -e \"$dylib\" -o ! -e \"$tocname\" ] || otool -l \"$dylib\" | grep -q LC_REEXPORT_DYLIB" 139 does_reexport_command = "[ ! -e \"$dylib\" -o ! -e \"$tocname\" ] || otool -l \"$dylib\" | grep -q LC_REEXPORT_DYLIB"
140 140
141 link_command = 141 link_command = "$ld -shared "
Robert Sesek 2016/05/06 19:17:36 This is the hack I mentioned in the standup: GN d
142 "$ld -shared {{ldflags}} -o \"$dylib\" -Wl,-filelist,\"$rspfile\""
143 if (is_component_build) { 142 if (is_component_build) {
144 link_command += " -Wl,-install_name,@rpath/{{target_output_name}}{{outpu t_extension}}" 143 link_command += " -Wl,-install_name,@rpath/\"{{target_output_name}}{{out put_extension}}\" "
145 } 144 }
146 link_command += " {{solibs}} {{libs}}" 145 link_command += "{{ldflags}} -o \"$dylib\" -Wl,-filelist,\"$rspfile\" {{li bs}} {{solibs}}"
147 146
148 replace_command = "if ! cmp -s \"$temporary_tocname\" \"$tocname\"; then m v \"$temporary_tocname\" \"$tocname\"" 147 replace_command = "if ! cmp -s \"$temporary_tocname\" \"$tocname\"; then m v \"$temporary_tocname\" \"$tocname\""
149 extract_toc_command = "{ otool -l \"$dylib\" | grep LC_ID_DYLIB -A 5; nm - gP \"$dylib\" | cut -f1-2 -d' ' | grep -v U\$\$; true; }" 148 extract_toc_command = "{ otool -l \"$dylib\" | grep LC_ID_DYLIB -A 5; nm - gP \"$dylib\" | cut -f1-2 -d' ' | grep -v U\$\$; true; }"
150 149
151 command = "if $does_reexport_command ; then $link_command && $extract_toc_ command > \"$tocname\"; else $link_command && $extract_toc_command > \"$temporar y_tocname\" && $replace_command ; fi; fi" 150 command = "if $does_reexport_command ; then $link_command && $extract_toc_ command > \"$tocname\"; else $link_command && $extract_toc_command > \"$temporar y_tocname\" && $replace_command ; fi; fi"
152 151
153 rspfile_content = "{{inputs_newline}}" 152 rspfile_content = "{{inputs_newline}}"
154 153
155 description = "SOLINK {{output}}" 154 description = "SOLINK {{output}}"
156 155
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 } 359 }
361 360
362 mac_toolchain("x64") { 361 mac_toolchain("x64") {
363 toolchain_cpu = "x64" 362 toolchain_cpu = "x64"
364 toolchain_os = "mac" 363 toolchain_os = "mac"
365 cc = "${goma_prefix}/gcc" 364 cc = "${goma_prefix}/gcc"
366 cxx = "${goma_prefix}/g++" 365 cxx = "${goma_prefix}/g++"
367 ld = cxx 366 ld = cxx
368 is_clang = false 367 is_clang = false
369 } 368 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698