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

Side by Side Diff: chrome/BUILD.gn

Issue 1961473003: [Mac/GN] Set up the component build. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments 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 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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/buildflag_header.gni") 5 import("//build/buildflag_header.gni")
6 import("//build/config/chrome_build.gni") 6 import("//build/config/chrome_build.gni")
7 import("//build/config/compiler/compiler.gni") 7 import("//build/config/compiler/compiler.gni")
8 import("//build/config/features.gni") 8 import("//build/config/features.gni")
9 import("//build/config/locales.gni") 9 import("//build/config/locales.gni")
10 import("//build/config/sanitizers/sanitizers.gni") 10 import("//build/config/sanitizers/sanitizers.gni")
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 "//third_party/widevine/cdm:widevinecdmadapter", 224 "//third_party/widevine/cdm:widevinecdmadapter",
225 ] 225 ]
226 226
227 if (is_multi_dll_chrome) { 227 if (is_multi_dll_chrome) {
228 defines += [ "CHROME_MULTIPLE_DLL" ] 228 defines += [ "CHROME_MULTIPLE_DLL" ]
229 data_deps += [ ":chrome_child" ] 229 data_deps += [ ":chrome_child" ]
230 } 230 }
231 } 231 }
232 } # !is_android && !is_mac 232 } # !is_android && !is_mac
233 233
234 if (is_mac) {
235 if (is_component_build) {
236 # On Mac component builds, this target is the bundle, and the main dll is
237 # just another shared library. This speeds up incremental builds by
238 # not requiring re-doing the bundle every time main_dll changes.
239 # See https://codereview.chromium.org/11420019
240
241 # TODO(GYP) chrome_dll for Mac component build.
242 assert(false)
243 } else {
244 # On Mac non-component builds, this is a no-op forwarding target.
245 group("chrome_dll") {
246 public_deps = [
247 ":chrome_framework",
248 ]
249 }
250 }
251 }
252
253 if (is_win) { 234 if (is_win) {
254 # This target is a forwarding target to compile the necessary DLLs used 235 # This target is a forwarding target to compile the necessary DLLs used
255 # by Chrome. 236 # by Chrome.
256 group("chrome_dll") { 237 group("chrome_dll") {
257 # TODO(GYP) support incremental_chrome_dll on Windows for faster links in 238 # TODO(GYP) support incremental_chrome_dll on Windows for faster links in
258 # developer component builds. When that's supported, this target will need 239 # developer component builds. When that's supported, this target will need
259 # to become more complicated. 240 # to become more complicated.
260 data_deps = [ 241 data_deps = [
261 ":main_dll", 242 ":main_dll",
262 ] 243 ]
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 deps += [ "//pdf" ] 376 deps += [ "//pdf" ]
396 } 377 }
397 } 378 }
398 } 379 }
399 } else if (is_mac) { 380 } else if (is_mac) {
400 chrome_helper_name = chrome_product_full_name + " Helper" 381 chrome_helper_name = chrome_product_full_name + " Helper"
401 chrome_framework_name = chrome_product_full_name + " Framework" 382 chrome_framework_name = chrome_product_full_name + " Framework"
402 383
403 group("chrome") { 384 group("chrome") {
404 deps = [ 385 deps = [
405 ":chrome_initial",
406 ]
407 }
408
409 group("chrome_initial") {
410 deps = [
411 ":chrome_app", 386 ":chrome_app",
412 ] 387 ]
413 } 388 }
414 389
415 tweak_info_plist("chrome_app_plist") { 390 tweak_info_plist("chrome_app_plist") {
416 info_plist = "app/app-Info.plist" 391 info_plist = "app/app-Info.plist"
417 args = [ 392 args = [
418 "--breakpad=0", 393 "--breakpad=0",
419 394
420 #"--keystone=???", # TODO(rsesek): Keystone. 395 #"--keystone=???", # TODO(rsesek): Keystone.
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 539
565 sources = [ 540 sources = [
566 "app/chrome_exe_main_mac.c", 541 "app/chrome_exe_main_mac.c",
567 ] 542 ]
568 543
569 defines = [ "HELPER_EXECUTABLE" ] 544 defines = [ "HELPER_EXECUTABLE" ]
570 545
571 deps = [ 546 deps = [
572 "//chrome/common:version_header", 547 "//chrome/common:version_header",
573 ] 548 ]
549
550 ldflags = [
551 # The helper is in Chromium.app/Contents/Versions/X/Chromium Helper.app/Co nents/MacOS/
552 # so set rpath up to the base.
553 "-rpath",
554 "@loader_path/../../../../../../..",
555 ]
574 } 556 }
575 557
576 bundle_data("chrome_framework_locales") { 558 bundle_data("chrome_framework_locales") {
577 sources = [] 559 sources = []
578 public_deps = [ 560 public_deps = [
579 ":repack_locales_pack", 561 ":repack_locales_pack",
580 ] 562 ]
581 563
582 foreach(locale, locales_as_mac_outputs) { 564 foreach(locale, locales_as_mac_outputs) {
583 sources += [ "$root_gen_dir/repack/locales/$locale.pak" ] 565 sources += [ "$root_gen_dir/repack/locales/$locale.pak" ]
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 640
659 #"--breakpad_uploads=???", # TODO(rsesek): Breakpad uploads. 641 #"--breakpad_uploads=???", # TODO(rsesek): Breakpad uploads.
660 642
661 "--keystone=0", 643 "--keystone=0",
662 "--scm=1", 644 "--scm=1",
663 "--branding", 645 "--branding",
664 chrome_product_short_name, 646 chrome_product_short_name,
665 ] 647 ]
666 } 648 }
667 649
668 mac_framework_bundle("chrome_framework") { 650 # On Mac, speed up the component build by not re-bundling the framework
669 output_name = chrome_framework_name 651 # every time it changes. Instead, place all the sources and their deps in
670 652 # a library that the bundled framework links (and re-exports). That way
671 configs += [ "//build/config/compiler:wexit_time_destructors" ] 653 # only the library needs to be re-linked when it changes.
654 if (is_component_build) {
655 _dll_target_type = "shared_library"
656 } else {
657 _dll_target_type = "source_set"
658 }
659 target(_dll_target_type, "chrome_dll") {
660 visibility = [
661 ":chrome_framework",
662 ":chrome_framework_shared_library",
663 ]
672 664
673 sources = [ 665 sources = [
674 "app/chrome_command_ids.h", 666 "app/chrome_command_ids.h",
675 "app/chrome_crash_reporter_client.cc", 667 "app/chrome_crash_reporter_client.cc",
676 "app/chrome_crash_reporter_client.h", 668 "app/chrome_crash_reporter_client.h",
677 "app/chrome_crash_reporter_client_mac.mm", 669 "app/chrome_crash_reporter_client_mac.mm",
678 "app/chrome_dll_resource.h", 670 "app/chrome_dll_resource.h",
679 "app/chrome_main.cc", 671 "app/chrome_main.cc",
680 "app/chrome_main_delegate.cc", 672 "app/chrome_main_delegate.cc",
681 "app/chrome_main_delegate.h", 673 "app/chrome_main_delegate.h",
682 "app/chrome_main_mac.h", 674 "app/chrome_main_mac.h",
683 "app/chrome_main_mac.mm", 675 "app/chrome_main_mac.mm",
684 ] 676 ]
685 677
678 deps = [
679 ":browser_dependencies",
680 ":child_dependencies",
681 "//chrome/common:features",
682 "//components/crash/content/app",
683 "//components/policy",
684 "//content/public/app:both",
685 "//third_party/cld_2",
686 ]
687
688 if (is_component_build) {
689 libs = [ "Carbon.framework" ]
690 }
691
692 ldflags = [
693 "-Wl,-order_file",
694 "-Wl," + rebase_path("app/framework.order", root_build_dir),
695 "-ObjC",
696 ]
697
698 if (enable_plugins && enable_pdf) {
699 deps += [ "//pdf" ]
700 }
701
702 if (enable_package_mash_services) {
703 deps += [ "//chrome/app/mash" ]
704 }
705 }
706
707 mac_framework_bundle("chrome_framework") {
708 output_name = chrome_framework_name
709
710 configs += [ "//build/config/compiler:wexit_time_destructors" ]
711
686 info_plist_target = ":chrome_framework_plist" 712 info_plist_target = ":chrome_framework_plist"
687 extra_substitutions = [ 713 extra_substitutions = [
688 "CHROMIUM_BUNDLE_ID=$chrome_mac_bundle_id", 714 "CHROMIUM_BUNDLE_ID=$chrome_mac_bundle_id",
689 "CHROMIUM_SHORT_NAME=$chrome_product_short_name", 715 "CHROMIUM_SHORT_NAME=$chrome_product_short_name",
690 ] 716 ]
691 717
718 public_deps = [
719 ":chrome_dll",
720 ]
721
692 deps = [ 722 deps = [
693 ":browser_dependencies",
694 ":child_dependencies",
695 ":chrome_framework_helpers", 723 ":chrome_framework_helpers",
696 ":chrome_framework_locales", 724 ":chrome_framework_locales",
697 ":chrome_framework_resources", 725 ":chrome_framework_resources",
698 "//build/config/sanitizers:deps", 726 "//build/config/sanitizers:deps",
699 "//chrome/app/nibs:chrome_xibs", 727 "//chrome/app/nibs:chrome_xibs",
700 "//chrome/common:features",
701 "//components/crash/content/app",
702 "//components/policy",
703 "//content/public/app:both",
704 "//third_party/cld_2",
705 ] 728 ]
706 729
707 ldflags = [ 730 ldflags = [
708 "-Wl,-order_file",
709 "-Wl," + rebase_path("app/framework.order", root_build_dir),
710 "-install_name", 731 "-install_name",
711 "@executable_path/../Versions/$chrome_version_full/$chrome_framework_name. framework/$chrome_framework_name", 732 "@executable_path/../Versions/$chrome_version_full/$chrome_framework_name. framework/$chrome_framework_name",
712 "-compatibility_version", 733 "-compatibility_version",
713 chrome_dylib_version, 734 chrome_dylib_version,
714 "-current_version", 735 "-current_version",
715 chrome_dylib_version, 736 chrome_dylib_version,
716 ] 737 ]
717 738
718 if (enable_plugins && enable_pdf) { 739 if (is_component_build) {
719 deps += [ "//pdf" ] 740 ldflags += [
720 } 741 "-rpath",
721 742 "@loader_path/../../../../..",
722 if (enable_package_mash_services) { 743 "-Wl,-reexport_library,libchrome_dll.dylib",
723 deps += [ "//chrome/app/mash" ] 744 ]
724 } 745 }
725 } 746 }
726 } 747 }
727 748
728 # GYP version: chromium_browser_dependencies variable in chrome.gyp 749 # GYP version: chromium_browser_dependencies variable in chrome.gyp
729 group("browser_dependencies") { 750 group("browser_dependencies") {
730 public_deps = [ 751 public_deps = [
731 "//chrome/browser", 752 "//chrome/browser",
732 "//chrome/common", 753 "//chrome/common",
733 "//sync", 754 "//sync",
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
1370 "//chrome/app/theme/$branding_path_component/product_logo_48.png", 1391 "//chrome/app/theme/$branding_path_component/product_logo_48.png",
1371 "//chrome/tools/build/linux/chrome-wrapper", 1392 "//chrome/tools/build/linux/chrome-wrapper",
1372 "//third_party/xdg-utils/scripts/xdg-mime", 1393 "//third_party/xdg-utils/scripts/xdg-mime",
1373 "//third_party/xdg-utils/scripts/xdg-settings", 1394 "//third_party/xdg-utils/scripts/xdg-settings",
1374 ] 1395 ]
1375 outputs = [ 1396 outputs = [
1376 "$root_out_dir/{{source_file_part}}", 1397 "$root_out_dir/{{source_file_part}}",
1377 ] 1398 ]
1378 } 1399 }
1379 } 1400 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698