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: chrome/BUILD.gn

Issue 1311543003: Add Linux build packaging targets to GN (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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/config/chrome_build.gni") 5 import("//build/config/chrome_build.gni")
6 import("//build/config/features.gni") 6 import("//build/config/features.gni")
7 import("//build/config/locales.gni") 7 import("//build/config/locales.gni")
8 import("//build/config/ui.gni") 8 import("//build/config/ui.gni")
9 import("//build/config/win/manifest.gni") 9 import("//build/config/win/manifest.gni")
10 import("//chrome/chrome_repack_locales.gni") 10 import("//chrome/chrome_repack_locales.gni")
11 import("//chrome/version.gni") 11 import("//chrome/version.gni")
12 12
13 if (is_android) { 13 if (is_android) {
14 import("//build/config/android/rules.gni") 14 import("//build/config/android/rules.gni")
15 } 15 }
16 16
17 if (!is_android) { 17 if (!is_android) {
18 # TODO(GYP) bug 512599: for Windows need to the the reorder-imports step 18 # TODO(GYP) bug 512599: for Windows need to the the reorder-imports step
19 # which probably means adding another target and renaming this to 19 # which probably means adding another target and renaming this to
20 # chrome_initial like in GYP. 20 # chrome_initial like in GYP.
21 executable("chrome") { 21 executable("chrome") {
22 # Because the sources list varies so significantly per-platform, generally 22 # Because the sources list varies so significantly per-platform, generally
23 # each platform lists its own files rather than relying on filtering or 23 # each platform lists its own files rather than relying on filtering or
24 # removing unused files. 24 # removing unused files.
25 sources = [ 25 sources = [
26 "app/chrome_exe_resource.h", 26 "app/chrome_exe_resource.h",
27 ] 27 ]
28 defines = [] 28 defines = []
29 public_deps = []
29 deps = [] 30 deps = []
30 data_deps = [] 31 data_deps = []
31 32
32 # TODO(GYP) mac_bundle_resources, xcode_settings 33 # TODO(GYP) mac_bundle_resources, xcode_settings
33 34
34 if (is_win) { 35 if (is_win) {
35 sources += [ 36 sources += [
36 "//content/public/common/content_switches.cc", 37 "//content/public/common/content_switches.cc",
37 "//content/public/common/content_switches.h", 38 "//content/public/common/content_switches.h",
38 "app/chrome_crash_reporter_client.cc", 39 "app/chrome_crash_reporter_client.cc",
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 # Chromium functionality directly into the executable. 112 # Chromium functionality directly into the executable.
112 ":browser_dependencies", 113 ":browser_dependencies",
113 ":child_dependencies", 114 ":child_dependencies",
114 ":manpage", 115 ":manpage",
115 "//base/allocator", 116 "//base/allocator",
116 117
117 # Needed to use the master_preferences functions 118 # Needed to use the master_preferences functions
118 "//chrome/installer/util", 119 "//chrome/installer/util",
119 "//content/public/app:both", 120 "//content/public/app:both",
120 ] 121 ]
122 public_deps = [
123 ":xdg_mime", # Needs to be public for installer to consume files.
124 ]
121 125
122 # Needed for chrome_main.cc initialization of libraries. 126 # Needed for chrome_main.cc initialization of libraries.
123 configs += [ "//build/config/linux:pangocairo" ] 127 configs += [ "//build/config/linux:pangocairo" ]
124 128
125 # GYP has this in a 'profiling==0 and linux_disable_pie==0' condition. 129 # GYP has this in a 'profiling==0 and linux_disable_pie==0' condition.
126 # but GN doesn't have either of these flags. 130 # but GN doesn't have either of these flags.
127 ldflags = [ "-pie" ] 131 ldflags = [ "-pie" ]
128 132
129 if (use_x11) { 133 if (use_x11) {
130 configs += [ 134 configs += [
131 "//build/config/linux:x11", 135 "//build/config/linux:x11",
132 "//build/config/linux:xext", 136 "//build/config/linux:xext",
133 ] 137 ]
134 } 138 }
135 } 139 }
136 140
137 if (is_mac) { 141 if (is_mac) {
138 sources += [ "app/chrome_exe_main_mac.cc" ] 142 sources += [ "app/chrome_exe_main_mac.cc" ]
139 # TODO(GYP) lots more stuff in the is_mac block. 143 # TODO(GYP) lots more stuff in the is_mac block.
140 } else { # Non-Mac. 144 } else { # Non-Mac.
141 # These files are used by the installer so we need a public dep. 145 # These files are used by the installer so we need a public dep.
142 public_deps = [ 146 public_deps += [
143 ":packed_extra_resources", 147 ":packed_extra_resources",
144 ":packed_resources", 148 ":packed_resources",
145 ] 149 ]
146 deps += [ 150 deps += [
147 "//components/startup_metric_utils", 151 "//components/startup_metric_utils",
148 152
149 # Precompiled plugins that need to get copied to the output directory. 153 # Precompiled plugins that need to get copied to the output directory.
150 # On Mac, internal plugins go inside the framework, so these 154 # On Mac, internal plugins go inside the framework, so these
151 # dependencies are on chrome.dll. 155 # dependencies are on chrome.dll.
152 "//third_party/adobe/flash:flapper_binaries", 156 "//third_party/adobe/flash:flapper_binaries",
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 # This one just uses the custom template and no separate sources. 360 # This one just uses the custom template and no separate sources.
357 sources = [] 361 sources = []
358 template_file = "version.h.in" 362 template_file = "version.h.in"
359 363
360 # TODO(brettw) this should move to $target_gen_dir/version.h and 364 # TODO(brettw) this should move to $target_gen_dir/version.h and
361 # source files including it should reference it via "chrome/version.h" 365 # source files including it should reference it via "chrome/version.h"
362 output = "$root_gen_dir/version.h" 366 output = "$root_gen_dir/version.h"
363 } 367 }
364 368
365 process_version("chrome_exe_version") { 369 process_version("chrome_exe_version") {
370 template_file = chrome_version_rc_template
366 sources = [ 371 sources = [
367 "app/chrome_exe.ver", 372 "app/chrome_exe.ver",
368 ] 373 ]
369 output = "$target_gen_dir/chrome_exe_version.rc" 374 output = "$target_gen_dir/chrome_exe_version.rc"
370 } 375 }
371 376
372 process_version("chrome_dll_version") { 377 process_version("chrome_dll_version") {
378 template_file = chrome_version_rc_template
373 sources = [ 379 sources = [
374 "app/chrome_dll.ver", 380 "app/chrome_dll.ver",
375 ] 381 ]
376 output = "$target_gen_dir/chrome_dll_version.rc" 382 output = "$target_gen_dir/chrome_dll_version.rc"
377 } 383 }
378 384
379 # This manifest matches what GYP produces. It may not even be necessary. 385 # This manifest matches what GYP produces. It may not even be necessary.
380 windows_manifest("chrome_dll_manifest") { 386 windows_manifest("chrome_dll_manifest") {
381 sources = [ 387 sources = [
382 as_invoker_manifest, 388 as_invoker_manifest,
383 common_controls_manifest, 389 common_controls_manifest,
384 ] 390 ]
385 type = "dll" 391 type = "dll"
386 } 392 }
387 393
388 process_version("nacl64_exe_version") { 394 process_version("nacl64_exe_version") {
395 template_file = chrome_version_rc_template
389 sources = [ 396 sources = [
390 "app/nacl64_exe.ver", 397 "app/nacl64_exe.ver",
391 ] 398 ]
392 output = "$target_gen_dir/nacl64_exe_version.rc" 399 output = "$target_gen_dir/nacl64_exe_version.rc"
393 } 400 }
394 401
395 process_version("other_version") { 402 process_version("other_version") {
403 template_file = chrome_version_rc_template
396 sources = [ 404 sources = [
397 "app/other.ver", 405 "app/other.ver",
398 ] 406 ]
399 output = "$target_gen_dir/other_version.rc" 407 output = "$target_gen_dir/other_version.rc"
400 } 408 }
401 409
402 source_set("image_pre_reader") { 410 source_set("image_pre_reader") {
403 sources = [ 411 sources = [
404 "app/image_pre_reader_win.cc", 412 "app/image_pre_reader_win.cc",
405 "app/image_pre_reader_win.h", 413 "app/image_pre_reader_win.h",
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 "browser/resources/default_apps/docs.crx", 472 "browser/resources/default_apps/docs.crx",
465 "browser/resources/default_apps/drive.crx", 473 "browser/resources/default_apps/drive.crx",
466 "browser/resources/default_apps/external_extensions.json", 474 "browser/resources/default_apps/external_extensions.json",
467 "browser/resources/default_apps/gmail.crx", 475 "browser/resources/default_apps/gmail.crx",
468 "browser/resources/default_apps/search.crx", 476 "browser/resources/default_apps/search.crx",
469 "browser/resources/default_apps/youtube.crx", 477 "browser/resources/default_apps/youtube.crx",
470 ] 478 ]
471 outputs = [ 479 outputs = [
472 "$root_out_dir/default_apps/{{source_file_part}}", 480 "$root_out_dir/default_apps/{{source_file_part}}",
473 ] 481 ]
482
483 # Force anybody that depends on this to get the default apps as data files.
484 data = process_file_template(sources, outputs)
474 } 485 }
475 } 486 }
476 487
477 group("packed_resources") { 488 group("packed_resources") {
478 deps = [ 489 public_deps = [
479 ":repack_locales_pack", 490 ":repack_locales_pack",
480 ":repack_pseudo_locales_pack", 491 ":repack_pseudo_locales_pack",
481 ":repack_chrome_100_percent", 492 ":repack_chrome_100_percent",
482 ] 493 ]
483 494
484 if (is_chrome_branded) { 495 if (is_chrome_branded) {
485 deps += [ ":default_apps" ] 496 public_deps += [ ":default_apps" ]
486 } 497 }
487 498
488 if (enable_hidpi) { 499 if (enable_hidpi) {
489 deps += [ ":repack_chrome_200_percent" ] 500 public_deps += [ ":repack_chrome_200_percent" ]
490 } 501 }
491 502
492 if (enable_topchrome_md) { 503 if (enable_topchrome_md) {
493 deps += [ ":repack_chrome_material_100_percent" ] 504 public_deps += [ ":repack_chrome_material_100_percent" ]
494 505
495 if (enable_hidpi) { 506 if (enable_hidpi) {
496 deps += [ ":repack_chrome_material_200_percent" ] 507 public_deps += [ ":repack_chrome_material_200_percent" ]
497 } 508 }
498 } 509 }
499 } 510 }
500 511
501 repack("packed_extra_resources") { 512 repack("packed_extra_resources") {
502 visibility = [ "./*" ] 513 visibility = [ "./*" ]
503 sources = [ 514 sources = [
504 "$root_gen_dir/chrome/browser_resources.pak", 515 "$root_gen_dir/chrome/browser_resources.pak",
505 "$root_gen_dir/chrome/chrome_unscaled_resources.pak", 516 "$root_gen_dir/chrome/chrome_unscaled_resources.pak",
506 "$root_gen_dir/chrome/common_resources.pak", 517 "$root_gen_dir/chrome/common_resources.pak",
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
917 "0", # TODO(GYP) This is linux_strip_binary if it is needed. 928 "0", # TODO(GYP) This is linux_strip_binary if it is needed.
918 rebase_path(chrome_binary, root_build_dir), 929 rebase_path(chrome_binary, root_build_dir),
919 rebase_path(symbol_file, root_build_dir), 930 rebase_path(symbol_file, root_build_dir),
920 ] 931 ]
921 932
922 deps = [ 933 deps = [
923 ":chrome", 934 ":chrome",
924 dump_syms_label, 935 dump_syms_label,
925 ] 936 ]
926 } 937 }
938
939 # Copies some scripts and resources that are used for desktop integration.
940 copy("xdg_mime") {
941 sources = [
942 "//chrome/app/theme/$branding_path_component/product_logo_48.png",
943 "//chrome/tools/build/linux/chrome-wrapper",
944 "//third_party/xdg-utils/scripts/xdg-mime",
945 "//third_party/xdg-utils/scripts/xdg-settings",
946 ]
947 outputs = [
948 "$root_out_dir/{{source_file_part}}",
949 ]
950 }
927 } 951 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698