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

Side by Side Diff: build/config/mac/base_rules.gni

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/mac/BUILD.gn ('k') | build/toolchain/mac/BUILD.gn » ('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 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 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 # This file contains rules that are shared between Mac and iOS. 5 # This file contains rules that are shared between Mac and iOS.
6 6
7 import("//build/toolchain/toolchain.gni") 7 import("//build/toolchain/toolchain.gni")
8 import("//build/config/mac/symbols.gni")
8 9
9 if (is_mac) { 10 if (is_mac) {
10 import("//build/config/mac/mac_sdk.gni") 11 import("//build/config/mac/mac_sdk.gni")
11 } else if (is_ios) { 12 } else if (is_ios) {
12 import("//build/config/ios/ios_sdk.gni") 13 import("//build/config/ios/ios_sdk.gni")
13 } 14 }
14 15
15 # Convert plist file to given format. 16 # Convert plist file to given format.
16 # 17 #
17 # Arguments 18 # Arguments
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 output_name = _output_name 308 output_name = _output_name
308 output_prefix_override = true 309 output_prefix_override = true
309 output_extension = "" 310 output_extension = ""
310 output_dir = "$target_out_dir/$_link_shared_library_target" 311 output_dir = "$target_out_dir/$_link_shared_library_target"
311 } 312 }
312 313
313 if (_is_fat_build) { 314 if (_is_fat_build) {
314 action(_lipo_shared_library_target) { 315 action(_lipo_shared_library_target) {
315 forward_variables_from(invoker, [ "testonly" ]) 316 forward_variables_from(invoker, [ "testonly" ])
316 visibility = _lipo_shared_library_visibility 317 visibility = _lipo_shared_library_visibility
317 script = "//build/config/mac/xcrun.py" 318 script = "//build/toolchain/mac/linker_driver.py"
318 outputs = [ 319 outputs = [
319 "$target_out_dir/$_lipo_shared_library_target/$_output_name", 320 "$target_out_dir/$_lipo_shared_library_target/$_output_name",
320 ] 321 ]
321 inputs = [ 322 inputs = [
322 "$target_out_dir/$_link_shared_library_target/$_output_name", 323 "$target_out_dir/$_link_shared_library_target/$_output_name",
323 ] 324 ]
324 deps = [ 325 deps = [
325 ":$_link_shared_library_target", 326 ":$_link_shared_library_target",
326 ] 327 ]
327 foreach(_additional_toolchain, additional_toolchains) { 328 foreach(_additional_toolchain, additional_toolchains) {
328 _additional_toolchain_target = "$_target_name($_additional_toolchain)" 329 _additional_toolchain_target = "$_target_name($_additional_toolchain)"
329 deps += [ ":$_additional_toolchain_target" ] 330 deps += [ ":$_additional_toolchain_target" ]
330 inputs += [ get_label_info(_additional_toolchain_target, 331 inputs += [ get_label_info(_additional_toolchain_target,
331 "target_out_dir") + "/$_output_name" ] 332 "target_out_dir") + "/$_output_name" ]
332 } 333 }
333 args = [ 334 args = [
335 "xcrun",
334 "lipo", 336 "lipo",
335 "-create", 337 "-create",
336 "-output", 338 "-output",
337 rebase_path(outputs[0], root_build_dir), 339 rebase_path(outputs[0], root_build_dir),
338 ] + rebase_path(inputs, root_build_dir) 340 ] + rebase_path(inputs, root_build_dir)
341
342 if (enable_dsyms) {
343 outputs += [ "$root_out_dir/$_output_name.dSYM/" ]
344 args +=
345 [ "-Wcrl,dsym," + rebase_path("$root_out_dir/.", root_build_dir) ]
346 }
347
348 if (enable_stripping) {
349 # Check whether //build/config/mac:strip_all has been removed from
350 # the configs variable (as this is how stripping is disabled for a
351 # single target).
352 _strip_all_in_config = false
353 if (defined(invoker.configs)) {
354 foreach(_config, invoker.configs) {
355 if (_config == "//build/config/mac:strip_all") {
356 _strip_all_in_config = true
357 }
358 }
359 }
360
361 if (_strip_all_in_config) {
362 args += [ "-Wcrl,strip,-x,-S" ]
363
364 if (save_unstripped_output) {
365 outputs += [ outputs[0] + ".unstripped" ]
366 args += [ "-Wcrl,unstripped," +
367 rebase_path(get_path_info(outputs[0], "dir"),
368 root_build_dir) ]
369 }
370 }
371 }
339 } 372 }
340 } 373 }
341 374
342 bundle_data(_shared_library_bundle_data) { 375 bundle_data(_shared_library_bundle_data) {
343 visibility = [ ":$_framework_target" ] 376 visibility = [ ":$_framework_target" ]
344 forward_variables_from(invoker, [ "testonly" ]) 377 forward_variables_from(invoker, [ "testonly" ])
345 outputs = [ 378 outputs = [
346 "{{bundle_executable_dir}}/$_output_name", 379 "{{bundle_executable_dir}}/$_output_name",
347 ] 380 ]
348 if (_is_fat_build) { 381 if (_is_fat_build) {
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 ] 501 ]
469 args = 502 args =
470 [ 503 [
471 "--input", 504 "--input",
472 "{{source}}", 505 "{{source}}",
473 "--output", 506 "--output",
474 rebase_path("$target_gen_dir/$target_name/{{source_name_part}}.nib"), 507 rebase_path("$target_gen_dir/$target_name/{{source_name_part}}.nib"),
475 ] + ibtool_flags 508 ] + ibtool_flags
476 } 509 }
477 } 510 }
OLDNEW
« no previous file with comments | « build/config/mac/BUILD.gn ('k') | build/toolchain/mac/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698