OLD | NEW |
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/features.gni") | 5 import("//build/config/features.gni") |
| 6 import("//build/config/locales.gni") |
6 import("//build/config/ui.gni") | 7 import("//build/config/ui.gni") |
| 8 import("//chrome/chrome_repack_locales.gni") |
7 import("//chrome/version.gni") | 9 import("//chrome/version.gni") |
8 | 10 |
9 # TODO(GYP) for Windows need to the the reorder-imports step which probably | 11 # TODO(GYP) for Windows need to the the reorder-imports step which probably |
10 # means adding another target and renaming this to chrome_initial like in GYP. | 12 # means adding another target and renaming this to chrome_initial like in GYP. |
11 executable("chrome") { | 13 executable("chrome") { |
12 # Because the sources list varies so significantly per-platform, generally | 14 # Because the sources list varies so significantly per-platform, generally |
13 # each platform lists its own files rather than relying on filtering or | 15 # each platform lists its own files rather than relying on filtering or |
14 # removing unused files. | 16 # removing unused files. |
15 sources = [ | 17 sources = [ |
16 "app/chrome_exe_resource.h", | 18 "app/chrome_exe_resource.h", |
17 ] | 19 ] |
18 deps = [] | 20 deps = [] |
| 21 datadeps = [] |
19 | 22 |
20 # TODO(GYP) mac_bundle_resources, xcode_settings | 23 # TODO(GYP) mac_bundle_resources, xcode_settings |
21 | 24 |
22 # TODO(GYP) order_profiling, order_text_section | 25 # TODO(GYP) order_profiling, order_text_section |
23 | 26 |
24 if (is_win) { | 27 if (is_win) { |
25 sources += [ | 28 sources += [ |
26 "app/chrome_exe_main_win.cc", | 29 "app/chrome_exe_main_win.cc", |
27 "app/client_util.cc", | 30 "app/client_util.cc", |
28 "app/client_util.h", | 31 "app/client_util.h", |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 "//build/config/linux:x11", | 75 "//build/config/linux:x11", |
73 "//build/config/linux:xext", | 76 "//build/config/linux:xext", |
74 ] | 77 ] |
75 } | 78 } |
76 } | 79 } |
77 | 80 |
78 if (is_mac) { | 81 if (is_mac) { |
79 sources += [ | 82 sources += [ |
80 "app/chrome_exe_main_mac.cc", | 83 "app/chrome_exe_main_mac.cc", |
81 ] | 84 ] |
| 85 # TODO(GYP) lots more stuff in the is_mac block. |
| 86 } else { # Non-Mac. |
| 87 deps += [ |
| 88 ":packed_extra_resources", |
| 89 ":packed_resources", |
| 90 |
| 91 # Copy Flash Player files to PRODUCT_DIR if applicable. Let the .gyp |
| 92 # file decide what to do on a per-OS basis; on Mac, internal plugins |
| 93 # go inside the framework, so this dependency is in chrome_dll.gypi. |
| 94 #'../third_party/adobe/flash/flash_player.gyp:flapper_binaries', TODO(GYP
) |
| 95 |
| 96 # Copy CDM files to PRODUCT_DIR if applicable. Let the .gyp |
| 97 # file decide what to do on a per-OS basis; on Mac, internal plugins |
| 98 # go inside the framework, so this dependency is in chrome_dll.gypi. |
| 99 #'../third_party/widevine/cdm/widevine_cdm.gyp:widevinecdmadapter', TODO(
GYP) |
| 100 ] |
| 101 |
| 102 # TODO(GYP) some stuff from GYP including chrome_multiple_dll. |
| 103 |
82 } | 104 } |
83 # TODO(GYP) is_mac | |
84 | 105 |
| 106 |
| 107 if (!is_mac && !is_android) { |
| 108 # On Mac this is done in chrome_dll.gypi. Android doesn't use pdfium. |
| 109 datadeps += [ "//pdf" ] |
| 110 |
| 111 # TODO(GYP) pdf linux symbols |
| 112 } |
85 } | 113 } |
86 | 114 |
87 shared_library("main_dll") { | 115 shared_library("main_dll") { |
88 configs += [ "//build/config/compiler:wexit_time_destructors" ] | 116 configs += [ "//build/config/compiler:wexit_time_destructors" ] |
89 | 117 |
90 deps = [ | 118 deps = [ |
91 ":browser_dependencies", | 119 ":browser_dependencies", |
92 "//base/allocator", | 120 "//base/allocator", |
93 ] | 121 ] |
94 if (is_win) { | 122 if (is_win) { |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 } | 294 } |
267 | 295 |
268 if (enable_extensions) { | 296 if (enable_extensions) { |
269 deps += [ | 297 deps += [ |
270 "//chrome/browser/resources:quota_internals_resources", | 298 "//chrome/browser/resources:quota_internals_resources", |
271 "//chrome/browser/resources:sync_file_system_internals_resources", | 299 "//chrome/browser/resources:sync_file_system_internals_resources", |
272 ] | 300 ] |
273 } | 301 } |
274 } | 302 } |
275 | 303 |
| 304 group("packed_resources") { |
| 305 deps = [ |
| 306 ":repack_locales_pack", |
| 307 ":repack_pseudo_locales_pack", |
| 308 ":repack_chrome_100_percent", |
| 309 ] |
| 310 |
| 311 # TODO(GYP) if (is_chrome_branded) { |
| 312 # ... copy default_apps from default_apps_list |
| 313 |
| 314 if (enable_hidpi) { |
| 315 deps += [ ":repack_chrome_200_percent" ] |
| 316 } |
| 317 } |
| 318 |
| 319 repack("packed_extra_resources") { |
| 320 visibility = ":*" |
| 321 sources = [ |
| 322 "$root_gen_dir/chrome/browser_resources.pak", |
| 323 "$root_gen_dir/chrome/app/theme/chrome_unscaled_resources.pak", |
| 324 "$root_gen_dir/chrome/common_resources.pak", |
| 325 "$root_gen_dir/chrome/browser/resources/invalidations_resources.pak", |
| 326 "$root_gen_dir/chrome/browser/resources/memory_internals_resources.pak", |
| 327 "$root_gen_dir/chrome/browser/resources/net_internals_resources.pak", |
| 328 "$root_gen_dir/chrome/browser/resources/password_manager_internals_resources
.pak", |
| 329 "$root_gen_dir/chrome/browser/resources/signin_internals_resources.pak", |
| 330 "$root_gen_dir/chrome/browser/resources/sync_internals_resources.pak", |
| 331 "$root_gen_dir/chrome/browser/resources/translate_internals_resources.pak", |
| 332 "$root_gen_dir/components/resources/component_resources.pak", |
| 333 "$root_gen_dir/net/net_resources.pak", |
| 334 "$root_gen_dir/ui/resources/webui_resources.pak", |
| 335 ] |
| 336 deps = [ |
| 337 "//chrome/browser:resources", |
| 338 "//chrome/app/theme:chrome_unscaled_resources", |
| 339 "//chrome/common:resources", |
| 340 "//chrome/browser/resources:invalidations_resources", |
| 341 "//chrome/browser/resources:memory_internals_resources", |
| 342 "//chrome/browser/resources:net_internals_resources", |
| 343 "//chrome/browser/resources:password_manager_internals_resources", |
| 344 "//chrome/browser/resources:signin_internals_resources", |
| 345 "//chrome/browser/resources:sync_internals_resources", |
| 346 "//chrome/browser/resources:translate_internals_resources", |
| 347 "//components/resources", |
| 348 "//net:net_resources", |
| 349 "//ui/resources", |
| 350 ] |
| 351 |
| 352 if (!is_ios && !is_android) { |
| 353 # New paks should be added here by default. |
| 354 sources += [ |
| 355 "$root_gen_dir/webkit/devtools_resources.pak", |
| 356 "$root_gen_dir/chrome/browser/resources/component_extension_resources.pak"
, |
| 357 "$root_gen_dir/chrome/browser/resources/options_resources.pak", |
| 358 "$root_gen_dir/chrome/browser/resources/quota_internals_resources.pak", |
| 359 "$root_gen_dir/chrome/browser/resources/sync_file_system_internals_resourc
es.pak", |
| 360 ] |
| 361 deps += [ |
| 362 "//content/browser/devtools:devtools_resources", |
| 363 "//chrome/browser/resources:component_extension_resources", |
| 364 "//chrome/browser/resources:options_resources", |
| 365 "//chrome/browser/resources:quota_internals_resources", |
| 366 "//chrome/browser/resources:sync_file_system_internals_resources", |
| 367 ] |
| 368 } |
| 369 if (!is_ios) { |
| 370 sources += [ |
| 371 "$root_gen_dir/blink/public/resources/blink_resources.pak", |
| 372 "$root_gen_dir/content/browser/tracing/tracing_resources.pak", |
| 373 "$root_gen_dir/content/content_resources.pak", |
| 374 "$root_gen_dir/extensions/extensions_renderer_resources.pak", |
| 375 "$root_gen_dir/extensions/extensions_resources.pak", |
| 376 ] |
| 377 } |
| 378 if (is_chromeos) { |
| 379 sources += [ "$root_gen_dir/ui/file_manager/file_manager_resources.pak" ] |
| 380 deps += [ "//ui/file_manager:resources" ] |
| 381 } |
| 382 if (enable_extensions) { |
| 383 sources += [ "$root_gen_dir/chrome/extensions_api_resources.pak" ] |
| 384 deps += [ "//chrome/common:extensions_api_resources" ] |
| 385 } |
| 386 |
| 387 # GYP outputs the file in the gen/repack directory. On non-Mac/iOS platforms |
| 388 # it them copies it. This skipes the copy step and writes it to the final |
| 389 # location. |
| 390 if (is_mac || is_ios) { |
| 391 output = "$root_gen_dir/repack/resources.pak" |
| 392 } else { |
| 393 output = "$root_out_dir/resources.pak" |
| 394 } |
| 395 } |
| 396 |
| 397 # Collects per-locale grit files from many sources into global per-locale files. |
| 398 chrome_repack_locales("repack_locales_pack") { |
| 399 visibility = ":*" |
| 400 |
| 401 input_locales = locales |
| 402 |
| 403 if (is_mac) { |
| 404 output_locales = locales_as_mac_outputs |
| 405 } else { |
| 406 output_locales = locales |
| 407 } |
| 408 } |
| 409 |
| 410 chrome_repack_locales("repack_pseudo_locales_pack") { |
| 411 visibility = ":*" |
| 412 |
| 413 input_locales = [ "fake-bidi" ] |
| 414 |
| 415 if (is_mac) { |
| 416 output_locales = [ "fake_bidi" ] # Mac uses underscores. |
| 417 } else { |
| 418 output_locales = [ "fake-bidi" ] |
| 419 } |
| 420 } |
| 421 |
| 422 # Generates a rule to repack a set of resources, substituting a given string |
| 423 # in for the percentage (e.g. "100", "200"). It generates the repacked files in |
| 424 # the "gen" directory, and then introduces a copy rule to copy it to the root |
| 425 # build directory. |
| 426 # |
| 427 # It's not clear why this two-step dance is necessary as opposed to just |
| 428 # generating the file in the destination. However, this is what the GYP build |
| 429 # does, and for maintenance purposes, this keeps the same files in the same |
| 430 # place between the two builds when possible. |
| 431 # |
| 432 # Argument: |
| 433 # percent [required] |
| 434 # String to substitute for the percentage. |
| 435 template("chrome_repack_percent") { |
| 436 percent = invoker.percent |
| 437 |
| 438 repack_name = "${target_name}_repack" |
| 439 repack_output_file = "$root_gen_dir/repack/chrome_${percent}_percent.pak" |
| 440 |
| 441 copy_name = target_name |
| 442 |
| 443 repack(repack_name) { |
| 444 visibility = ":$copy_name" |
| 445 # All sources should also have deps for completeness. |
| 446 sources = [ |
| 447 "$root_gen_dir/components/resources/component_resources_${percent}_percent
.pak", |
| 448 "$root_gen_dir/ui/resources/ui_resources_${percent}_percent.pak", |
| 449 "$root_gen_dir/chrome/renderer_resources_${percent}_percent.pak", |
| 450 "$root_gen_dir/chrome/app/theme/theme_resources_${percent}_percent.pak", |
| 451 ] |
| 452 |
| 453 deps = [ |
| 454 "//chrome/app/theme:theme_resources", |
| 455 "//chrome/renderer:resources", |
| 456 "//components/strings", |
| 457 "//net:net_resources", |
| 458 ] |
| 459 |
| 460 if (!is_ios) { |
| 461 sources += [ |
| 462 "$root_gen_dir/content/app/resources/content_resources_${percent}_percen
t.pak", |
| 463 ] |
| 464 deps += [ "//content:resources" ] |
| 465 } |
| 466 if (use_ash) { |
| 467 sources += [ "$root_gen_dir/ash/resources/ash_resources_${percent}_percent
.pak" ] |
| 468 deps += [ "//ash/resources" ] |
| 469 } |
| 470 if (use_athena) { |
| 471 sources += [ |
| 472 "$root_gen_dir/athena/resources/athena_resources_${percent}_percent.pak"
, |
| 473 ] |
| 474 deps += [ "//athena/resources" ] |
| 475 } |
| 476 if (is_chromeos) { |
| 477 sources += [ |
| 478 "$root_gen_dir/ui/chromeos/resources/ui_chromeos_resources_${percent}_pe
rcent.pak", |
| 479 ] |
| 480 deps += [ "//ui/chromeos/resources" ] |
| 481 } |
| 482 |
| 483 output = repack_output_file |
| 484 } |
| 485 |
| 486 copy(copy_name) { |
| 487 visibility = ":*" |
| 488 deps = [ ":$repack_name" ] |
| 489 sources = [ repack_output_file ] |
| 490 outputs = [ "$root_build_dir/chrome_${percent}_percent.pak" ] |
| 491 } |
| 492 } |
| 493 |
| 494 chrome_repack_percent("repack_chrome_100_percent") { |
| 495 percent = "100" |
| 496 } |
| 497 |
| 498 if (enable_hidpi) { |
| 499 chrome_repack_percent("repack_chrome_200_percent") { |
| 500 percent = "200" |
| 501 } |
| 502 } |
| 503 |
276 # GYP version: chrome/chrome_resources.gyp:chrome_strings | 504 # GYP version: chrome/chrome_resources.gyp:chrome_strings |
277 group("strings") { | 505 group("strings") { |
278 deps = [ | 506 deps = [ |
279 "//chrome/app:chromium_strings", | 507 "//chrome/app:chromium_strings", |
280 "//chrome/app:generated_resources", | 508 "//chrome/app:generated_resources", |
281 "//chrome/app:google_chrome_strings", | 509 "//chrome/app:google_chrome_strings", |
282 "//chrome/app/resources:locale_settings", | 510 "//chrome/app/resources:locale_settings", |
283 ] | 511 ] |
284 } | 512 } |
OLD | NEW |