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

Side by Side Diff: chrome/BUILD.gn

Issue 1930403003: [Mac/GN] Get chrome and chrome_framework building. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gn-chrome-app-shim
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 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 11 matching lines...) Expand all
22 # 0 : Means that PGO is turned off. 22 # 0 : Means that PGO is turned off.
23 # 1 : Used during the PGI (instrumentation) phase. 23 # 1 : Used during the PGI (instrumentation) phase.
24 # 2 : Used during the PGO (optimization) phase. 24 # 2 : Used during the PGO (optimization) phase.
25 # 25 #
26 # TODO(sebmarchand): Add support for the PGU (update) phase. 26 # TODO(sebmarchand): Add support for the PGU (update) phase.
27 chrome_pgo_phase = 0 27 chrome_pgo_phase = 0
28 } 28 }
29 29
30 if (is_android) { 30 if (is_android) {
31 import("//build/config/android/rules.gni") 31 import("//build/config/android/rules.gni")
32 } else if (is_mac) {
33 import("//build/compiled_action.gni")
34 import("//build/config/mac/rules.gni")
35 import("//build/util/branding.gni")
36 import("//build/util/version.gni")
37 import("//build_overrides/v8.gni")
32 } 38 }
33 39
34 if (is_win) { 40 if (is_win) {
35 action("reorder_imports") { 41 action("reorder_imports") {
36 script = "//build/win/reorder-imports.py" 42 script = "//build/win/reorder-imports.py"
37 43
38 # See comment in chrome_dll.gypi in the hardlink_to_output 44 # See comment in chrome_dll.gypi in the hardlink_to_output
39 # target for why this cannot be 'initial' like the DLL. 45 # target for why this cannot be 'initial' like the DLL.
40 inputs = [ 46 inputs = [
41 "$root_out_dir/initialexe/chrome.exe", 47 "$root_out_dir/initialexe/chrome.exe",
42 ] 48 ]
43 outputs = [ 49 outputs = [
44 "$root_out_dir/chrome.exe", 50 "$root_out_dir/chrome.exe",
45 "$root_out_dir/chrome.exe.pdb", 51 "$root_out_dir/chrome.exe.pdb",
46 ] 52 ]
47 args = [ 53 args = [
48 "-i", 54 "-i",
49 rebase_path("$root_out_dir/initialexe", root_build_dir), 55 rebase_path("$root_out_dir/initialexe", root_build_dir),
50 "-o", 56 "-o",
51 rebase_path("$root_out_dir", root_build_dir), 57 rebase_path("$root_out_dir", root_build_dir),
52 "-a", 58 "-a",
53 target_cpu, 59 target_cpu,
54 ] 60 ]
55 deps = [ 61 deps = [
56 ":chrome_initial", 62 ":chrome_initial",
57 ] 63 ]
58 } 64 }
59 } 65 }
60 66
61 if (!is_android) { 67 if (!is_android && !is_mac) {
62 group("chrome") { 68 group("chrome") {
63 public_deps = [ 69 public_deps = [
64 ":chrome_initial", 70 ":chrome_initial",
65 ] 71 ]
66 if (is_win) { 72 if (is_win) {
67 public_deps += [ ":reorder_imports" ] 73 public_deps += [ ":reorder_imports" ]
68 } 74 }
69 } 75 }
70 76
71 executable("chrome_initial") { 77 executable("chrome_initial") {
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 "//build/config/linux:xext", 216 "//build/config/linux:xext",
211 ] 217 ]
212 } 218 }
213 219
214 if (enable_package_mash_services) { 220 if (enable_package_mash_services) {
215 deps += [ "//chrome/app/mash" ] 221 deps += [ "//chrome/app/mash" ]
216 data_deps += [ "//chrome/app:mojo_manifests" ] 222 data_deps += [ "//chrome/app:mojo_manifests" ]
217 } 223 }
218 } 224 }
219 225
220 if (is_mac) { 226 # These files are used by the installer so we need a public dep.
221 sources += [ "app/chrome_exe_main_mac.c" ] 227 public_deps += [
222 deps += [ ":chrome_dll" ] 228 ":packed_extra_resources",
229 ":packed_resources",
230 ]
231 deps += [
232 "//components/startup_metric_utils/browser:lib",
223 233
224 # TODO(GYP) lots more stuff in the is_mac block. 234 # Precompiled plugins that need to get copied to the output directory.
225 } else { # Non-Mac. 235 # On Mac, internal plugins go inside the framework, so these
226 # These files are used by the installer so we need a public dep. 236 # dependencies are on chrome.dll.
227 public_deps += [ 237 "//third_party/adobe/flash:flapper_binaries",
228 ":packed_extra_resources", 238 "//third_party/widevine/cdm:widevinecdmadapter",
229 ":packed_resources", 239 ]
230 ]
231 deps += [
232 "//components/startup_metric_utils/browser:lib",
233
234 # Precompiled plugins that need to get copied to the output directory.
235 # On Mac, internal plugins go inside the framework, so these
236 # dependencies are on chrome.dll.
237 "//third_party/adobe/flash:flapper_binaries",
238 "//third_party/widevine/cdm:widevinecdmadapter",
239 ]
240 }
241 240
242 if (is_multi_dll_chrome) { 241 if (is_multi_dll_chrome) {
243 defines += [ "CHROME_MULTIPLE_DLL" ] 242 defines += [ "CHROME_MULTIPLE_DLL" ]
244 data_deps += [ ":chrome_child" ] 243 data_deps += [ ":chrome_child" ]
245 } 244 }
246 } 245 }
247 } # !is_android 246 } # !is_android && !is_mac
248 247
249 if (is_mac) { 248 if (is_mac) {
250 if (is_component_build) { 249 if (is_component_build) {
251 # On Mac component builds, this target is the bundle, and the main dll is 250 # On Mac component builds, this target is the bundle, and the main dll is
252 # just another shared library. This speeds up incremental builds by 251 # just another shared library. This speeds up incremental builds by
253 # not requiring re-doing the bundle every time main_dll changes. 252 # not requiring re-doing the bundle every time main_dll changes.
254 # See https://codereview.chromium.org/11420019 253 # See https://codereview.chromium.org/11420019
255 254
256 # TODO(GYP) chrome_dll for Mac component build. 255 # TODO(GYP) chrome_dll for Mac component build.
257 assert(false) 256 assert(false)
258 } else { 257 } else {
259 # On Mac non-component builds, this is a no-op forwarding target. 258 # On Mac non-component builds, this is a no-op forwarding target.
260 group("chrome_dll") { 259 group("chrome_dll") {
261 public_deps = [ 260 public_deps = [
262 ":main_dll", 261 ":chrome_framework",
263 ] 262 ]
264 } 263 }
265 } 264 }
266 } 265 }
267 266
268 if (is_win) { 267 if (is_win) {
269 # This target is a forwarding target to compile the necessary DLLs used 268 # This target is a forwarding target to compile the necessary DLLs used
270 # by Chrome. 269 # by Chrome.
271 group("chrome_dll") { 270 group("chrome_dll") {
272 # TODO(GYP) support incremental_chrome_dll on Windows for faster links in 271 # TODO(GYP) support incremental_chrome_dll on Windows for faster links in
273 # developer component builds. When that's supported, this target will need 272 # developer component builds. When that's supported, this target will need
274 # to become more complicated. 273 # to become more complicated.
275 data_deps = [ 274 data_deps = [
276 ":main_dll", 275 ":main_dll",
277 ] 276 ]
278 if (is_multi_dll_chrome) { 277 if (is_multi_dll_chrome) {
279 data_deps += [ ":chrome_child" ] 278 data_deps += [ ":chrome_child" ]
280 } 279 }
281 } 280 }
282 }
283 281
284 if (is_mac || is_win) {
285 shared_library("main_dll") { 282 shared_library("main_dll") {
286 configs += [ "//build/config/compiler:wexit_time_destructors" ] 283 configs += [ "//build/config/compiler:wexit_time_destructors" ]
287 defines = [] 284 defines = []
288 ldflags = [] 285 ldflags = []
289 286
290 sources = [ 287 sources = [
291 "//base/win/dllmain.cc", 288 "//base/win/dllmain.cc",
292 "app/chrome_command_ids.h", 289 "app/chrome_command_ids.h",
293 "app/chrome_dll.rc", 290 "app/chrome_dll.rc",
294 "app/chrome_dll_resource.h", 291 "app/chrome_dll_resource.h",
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 if (is_multi_dll_chrome) { 341 if (is_multi_dll_chrome) {
345 defines += [ "CHROME_MULTIPLE_DLL_BROWSER" ] 342 defines += [ "CHROME_MULTIPLE_DLL_BROWSER" ]
346 deps += [ "//content/public/app:browser" ] 343 deps += [ "//content/public/app:browser" ]
347 } else { 344 } else {
348 deps += [ 345 deps += [
349 ":child_dependencies", 346 ":child_dependencies",
350 "//content/public/app:both", 347 "//content/public/app:both",
351 ] 348 ]
352 } 349 }
353 350
354 if (is_mac) {
355 #['OS=="mac" and component!="shared_library"', { TODO(GYP)
356 # 'includes': [ 'chrome_dll_bundle.gypi' ],
357 #}],
358 # TODO(GYP) Lots of other stuff in the OS=="mac" block.
359 sources += [
360 "app/chrome_crash_reporter_client.cc",
361 "app/chrome_crash_reporter_client.h",
362 "app/chrome_crash_reporter_client_mac.mm",
363 ]
364 deps += [
365 "//components/crash/content/app",
366 "//components/policy",
367 ]
368
369 # Define the order of symbols within the framework.
370 ldflags += [
371 "-Wl,-order_file",
372 "-Wl," + rebase_path("app/framework.order", root_build_dir),
373 ]
374 }
375
376 if (enable_plugins && enable_pdf && !is_multi_dll_chrome) { 351 if (enable_plugins && enable_pdf && !is_multi_dll_chrome) {
377 deps += [ "//pdf" ] 352 deps += [ "//pdf" ]
378 } 353 }
379 354
380 if (enable_package_mash_services) { 355 if (enable_package_mash_services) {
381 deps += [ "//chrome/app/mash" ] 356 deps += [ "//chrome/app/mash" ]
382 } 357 }
383 } 358 }
384 359
385 if (is_multi_dll_chrome) { 360 if (is_multi_dll_chrome) {
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 } 416 }
442 } 417 }
443 418
444 deps += [ "//chrome/browser/policy:path_parser" ] 419 deps += [ "//chrome/browser/policy:path_parser" ]
445 420
446 if (enable_plugins && enable_pdf) { 421 if (enable_plugins && enable_pdf) {
447 deps += [ "//pdf" ] 422 deps += [ "//pdf" ]
448 } 423 }
449 } 424 }
450 } 425 }
426 } else if (is_mac) {
427 chrome_helper_name = chrome_product_full_name + " Helper"
428 chrome_framework_name = chrome_product_full_name + " Framework"
429
430 group("chrome_initial") {
431 deps = [
432 ":chrome",
433 ]
434 }
435
436 mac_app_bundle("chrome") {
437 output_name = chrome_product_full_name
438
439 info_plist = "app/app-Info.plist"
440
441 sources = [
442 "app/chrome_exe_main_mac.c",
443 ]
444
445 deps = [
446 ":chrome_app_strings_bundle_data",
447 ":chrome_resources",
448 ":chrome_versioned_bundle_data",
449 "//chrome/common:version_header",
450 ]
451 }
452
453 compiled_action("chrome_app_strings") {
454 tool = "//chrome/tools/mac_helpers:infoplist_strings_tool"
455
456 inputs = [
457 chrome_version_file,
458 ]
459
460 outputs = []
461
462 foreach(locale, locales) {
463 if (is_chrome_branded) {
464 _strings_file = "google_chrome_strings"
465 } else {
466 _strings_file = "chromium_strings"
467 }
468
469 inputs += [ "$root_gen_dir/chrome/${_strings_file}_${locale}.pak" ]
470 }
471
472 foreach(locale, locales_as_mac_outputs) {
473 outputs += [ "$target_gen_dir/app_infoplist_strings/$locale.lproj/InfoPlis t.strings" ]
474 }
475
476 args =
477 [
478 "-b",
479 "${branding_path_component}_strings",
480 "-v",
481 rebase_path(chrome_version_file, root_build_dir),
482 "-g",
483 rebase_path("$root_gen_dir/chrome", root_build_dir),
484 "-o",
485 rebase_path("$target_gen_dir/app_infoplist_strings", root_build_dir),
486 "-t",
487 "main",
488 ] + locales
489
490 if (is_chrome_branded) {
491 deps = [
492 "//chrome/app:google_chrome_strings",
493 ]
494 } else {
495 deps = [
496 "//chrome/app:chromium_strings",
497 ]
498 }
499 }
500
501 foreach(locale, locales_as_mac_outputs) {
502 bundle_data("chrome_app_strings_${locale}_bundle_data") {
503 sources = [
504 "$target_gen_dir/app_infoplist_strings/$locale.lproj/InfoPlist.strings",
505 ]
506 outputs = [
507 "{{bundle_resources_dir}}/$locale.lproj/{{source_file_part}}",
508 ]
509 public_deps = [
510 ":chrome_app_strings",
511 ]
512 }
513 }
514 group("chrome_app_strings_bundle_data") {
515 public_deps = []
516 foreach(locale, locales_as_mac_outputs) {
517 public_deps += [ ":chrome_app_strings_${locale}_bundle_data" ]
518 }
519 }
520
521 bundle_data("chrome_resources") {
522 sources = [
523 "app/theme/$branding_path_component/mac/app.icns",
524 "app/theme/$branding_path_component/mac/document.icns",
525 "browser/ui/cocoa/applescript/scripting.sdef",
526
527 # TODO(rsesek): mac_bundle_id.manifest
528 ]
529
530 outputs = [
531 "{{bundle_resources_dir}}/{{source_file_part}}",
532 ]
533
534 deps = [
535 ":chrome_app_strings",
536 ]
537 }
538
539 bundle_data("chrome_versioned_bundle_data") {
540 sources = [
541 "$root_out_dir/$chrome_framework_name.framework",
542 "$root_out_dir/$chrome_helper_name.app",
543 ]
544 outputs = [
545 "{{bundle_root_dir}}/Versions/$chrome_version_full/{{source_file_part}}",
546 ]
547 public_deps = [
548 ":chrome_framework",
549 ":chrome_helper_app",
550 ]
551 }
552
553 mac_app_bundle("chrome_helper_app") {
554 output_name = chrome_helper_name
555
556 info_plist = "app/helper-Info.plist"
557
558 sources = [
559 "app/chrome_exe_main_mac.c",
560 ]
561
562 defines = [ "HELPER_EXECUTABLE" ]
563
564 deps = [
565 "//chrome/common:version_header",
566 ]
567 }
568
569 bundle_data("chrome_framework_locales") {
570 sources = []
571 public_deps = [
572 ":repack_locales_pack",
573 ]
574
575 foreach(locale, locales_as_mac_outputs) {
576 sources += [ "$root_gen_dir/repack/locales/$locale.pak" ]
577 }
578
579 outputs = [
580 "{{bundle_resources_dir}}/{{source_name_part}}.lproj/locale.pak",
581 ]
582 }
583
584 bundle_data("chrome_framework_helpers") {
585 sources = [
586 "$root_out_dir/crashpad_handler",
587 ]
588
589 outputs = [
590 "{{bundle_root_dir}}/Helpers/{{source_file_part}}",
591 ]
592
593 public_deps = [
594 "//third_party/crashpad/crashpad/handler:crashpad_handler",
595 ]
596 }
597
598 bundle_data("chrome_framework_resources") {
599 sources = [
600 # This image is used to badge the lock icon in the
601 # authentication dialogs, such as those used for installation
602 # from disk image and Keystone promotion (if so enabled). It
603 # needs to exist as a file on disk and not just something in a
604 # resource bundle because that's the interface that
605 # Authorization Services uses. Also, Authorization Services
606 # can't deal with .icns files.
607 "$root_gen_dir/repack/resources.pak",
608 "$root_out_dir/app_mode_loader.app",
609 "$root_out_dir/chrome_100_percent.pak",
610 "$root_out_dir/icudtl.dat",
611 "app/theme/default_100_percent/$branding_path_component/product_logo_32.pn g",
612
613 # TODO(rsesek): pdfsqueeze the PDFs
614 "app/theme/find_next_Template.pdf",
615 "app/theme/find_prev_Template.pdf",
616 "app/theme/menu_overflow_down.pdf",
617 "app/theme/menu_overflow_up.pdf",
618 "browser/mac/install.sh",
619 ]
620
621 outputs = [
622 "{{bundle_resources_dir}}/{{source_file_part}}",
623 ]
624
625 public_deps = [
626 ":packed_extra_resources",
627 ":packed_resources",
628 "//chrome/app_shim:app_mode_loader",
629 "//third_party/icu:icudata",
630 ]
631
632 if (enable_hidpi) {
633 sources += [ "$root_out_dir/chrome_200_percent.pak" ]
634 }
635
636 if (enable_topchrome_md) {
637 sources += [ "$root_out_dir/chrome_material_100_percent.pak" ]
638
639 if (enable_hidpi) {
640 sources += [ "$root_out_dir/chrome_material_200_percent.pak" ]
641 }
642 }
643
644 if (v8_use_external_startup_data) {
645 sources += [
646 "$root_out_dir/natives_blob.bin",
647 "$root_out_dir/snapshot_blob.bin",
648 ]
649 public_deps += [ "//v8" ]
650 }
651 }
652
653 mac_framework_bundle("chrome_framework") {
654 output_name = chrome_framework_name
655
656 configs += [ "//build/config/compiler:wexit_time_destructors" ]
657
658 sources = [
659 "app/chrome_command_ids.h",
660 "app/chrome_crash_reporter_client.cc",
661 "app/chrome_crash_reporter_client.h",
662 "app/chrome_crash_reporter_client_mac.mm",
663 "app/chrome_dll_resource.h",
664 "app/chrome_main.cc",
665 "app/chrome_main_delegate.cc",
666 "app/chrome_main_delegate.h",
667 "app/chrome_main_mac.h",
668 "app/chrome_main_mac.mm",
669 ]
670
671 info_plist = "app/framework-Info.plist"
672
673 deps = [
674 ":browser_dependencies",
675 ":child_dependencies",
676 ":chrome_framework_helpers",
677 ":chrome_framework_locales",
678 ":chrome_framework_resources",
679 "//build/config/sanitizers:deps",
680 "//chrome/app/nibs:chrome_xibs",
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 ldflags = [
689 "-Wl,-order_file",
690 "-Wl," + rebase_path("app/framework.order", root_build_dir),
691 "-install_name",
692 "@executable_path/../Versions/$chrome_version_full/$chrome_framework_name. framework/$chrome_framework_name",
693 "-compatibility_version",
694 chrome_dylib_version,
695 "-current_version",
696 chrome_dylib_version,
697 ]
698
699 if (enable_plugins && enable_pdf) {
700 deps += [ "//pdf" ]
701 }
702
703 if (enable_package_mash_services) {
704 deps += [ "//chrome/app/mash" ]
705 }
706 }
451 } 707 }
452 708
453 # GYP version: chromium_browser_dependencies variable in chrome.gyp 709 # GYP version: chromium_browser_dependencies variable in chrome.gyp
454 group("browser_dependencies") { 710 group("browser_dependencies") {
455 public_deps = [ 711 public_deps = [
456 "//chrome/browser", 712 "//chrome/browser",
457 "//chrome/common", 713 "//chrome/common",
458 "//sync", 714 "//sync",
459 ] 715 ]
460 if (enable_plugins) { 716 if (enable_plugins) {
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
1093 "//chrome/app/theme/$branding_path_component/product_logo_48.png", 1349 "//chrome/app/theme/$branding_path_component/product_logo_48.png",
1094 "//chrome/tools/build/linux/chrome-wrapper", 1350 "//chrome/tools/build/linux/chrome-wrapper",
1095 "//third_party/xdg-utils/scripts/xdg-mime", 1351 "//third_party/xdg-utils/scripts/xdg-mime",
1096 "//third_party/xdg-utils/scripts/xdg-settings", 1352 "//third_party/xdg-utils/scripts/xdg-settings",
1097 ] 1353 ]
1098 outputs = [ 1354 outputs = [
1099 "$root_out_dir/{{source_file_part}}", 1355 "$root_out_dir/{{source_file_part}}",
1100 ] 1356 ]
1101 } 1357 }
1102 } 1358 }
OLDNEW
« build/util/branding.gni ('K') | « build/util/version.gni ('k') | chrome/app/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698