• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2016 The Chromium Embedded Framework Authors. Portions copyright
2# 2014 the Chromium Authors. All rights reserved. Use of this source code is
3# governed by a BSD-style license that can be found in the LICENSE file.
4#
5# This file provides the GN configuration for the CEF project. This is not a
6# stand-alone configuration -- it must be built from inside the Chromium source
7# tree. See https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
8# for complete CEF build instructions. See below for links to additional GN
9# documentation.
10#
11# GN Setup:
12#
13#    Optionally configure GN by setting the `GN_DEFINES` and/or `GN_ARGUMENTS`
14#    environment variables.
15#
16#    Example A: Create an official build on Windows:
17#
18#      > set GN_DEFINES=is_official_build=true
19#
20#    Example B: Generate VS2017 project files in addition to the default Ninja
21#               build files on Windows:
22#
23#      > set GN_ARGUMENTS=--ide=vs2017 --sln=cef --filters=//cef/*
24#
25#      After completing the "GN Automated Build" or "GN Manual Build" section
26#      open "out\<build_dir>\cef.sln" for editing and debugging. Building must
27#      still be performed using the Ninja command-line.
28#
29# GN Automated Build:
30#
31#    Run the `automate-git.py` script as described on the BranchesAndBuilding
32#    Wiki page. GN, unlike GYP, supports parallel build configurations. The
33#    following command-line flags have special meaning with GN builds:
34#
35#    --x64-build    Perform an x64 build if specified (requires out/*_GN_x64
36#                   directories), otherwise perform an x86 build (requires
37#                   out/*_GN_x86 directories).
38#
39#    Directories are created subject to your platform and `GN_DEFINES` settings.
40#    See Step 1B in the "GN Manual Build" section below for details.
41#
42# GN Manual Build:
43#
44# 1. Run the `cef_create_projects.[bin|sh]` script. Upon successful completion
45#    proceed to Step 2.
46#
47#    The `cef_create_projects.[bin|sh]` script will automatically do all of the
48#    following:
49#
50#    A. Apply patch files to the Chromium source tree. This includes
51#       `patch/patches/gn_config.patch` which is required for GN integration.
52#
53#    B. Create multiple build output directories appropriate to your platform
54#       and `GN_DEFINES` settings. For example:
55#
56#         x86 debug build   -> out/Debug_GN_x86
57#         x86 release build -> out/Release_GN_x86
58#         x64 debug build   -> out/Debug_GN_x64
59#         x64 release build -> out/Release_GN_x64
60#
61#       Build output directories will be created subject to the following rules
62#       (defined in `tools/gn_args.py` GetAllPlatformConfigs):
63#
64#       - Debug and Release directories will be created on all platforms by
65#         default. Debug directories will not be created when `is_asan=true`.
66#       - x64 directories will always be created on all platforms.
67#       - x86 directories will always be created on Windows.
68#       - x86 directories will be created on Linux when `use_sysroot=true`.
69#
70#    C. Write the `args.gn` file for each build output directory using the
71#       `tools/gn_args.py` script to determine the GN arguments. Some arguments
72#       are required and some are optional. See script output for details in
73#       case of conflicts or recommendations.
74#
75#    D. Run `gn gen` for each build output directory to generate project files.
76#       Ninja files will be generated by default. Additional command-line
77#       arguments (including other project formats) can be specified via the
78#       `GN_ARGUMENTS` environment variable. Run `gn gen --help` for a list of
79#       supported arguments.
80#
81# 2. Run Ninja from the command-line to build. If the build configuration has
82#    changed it will automatically re-run `gn gen` with the same arguments.
83#
84#    > ninja -C out/<build_dir> cefclient cefsimple ceftests
85#
86# GN Manual Packaging:
87#
88#    Run the `make_distrib.[bat|sh]` script as described on the
89#    BranchesAndBuilding Wiki page.
90#
91# Additional GN documentation:
92# http://www.chromium.org/developers/gn-build-configuration
93# https://chromium.googlesource.com/chromium/src/+/master/tools/gn/docs/language.md
94#
95
96import("//base/allocator/allocator.gni")
97import("//build/config/features.gni")
98import("//build/config/locales.gni")
99import("//build/config/sanitizers/sanitizers.gni")
100import("//build/config/ui.gni")
101import("//chrome/common/features.gni")
102import("//content/public/app/mac_helpers.gni")
103import("//extensions/buildflags/buildflags.gni")
104import("//media/media_options.gni")
105import("//mojo/public/tools/bindings/mojom.gni")
106import("//ppapi/buildflags/buildflags.gni")
107import("//printing/buildflags/buildflags.gni")
108import("//testing/test.gni")
109import("//third_party/icu/config.gni")
110import("//third_party/widevine/cdm/widevine.gni")
111import("//tools/grit/repack.gni")
112import("//tools/grit/grit_rule.gni")
113import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
114import("//ui/gl/features.gni")
115import("//v8/gni/v8.gni")
116if (is_clang) {
117  import("//build/config/clang/clang.gni")
118}
119if (is_linux) {
120  import("//build/config/linux/pkg_config.gni")
121  import("//third_party/fontconfig/fontconfig.gni")
122}
123if (is_mac) {
124  import("//build/apple/tweak_info_plist.gni")
125  import("//build/config/mac/rules.gni")
126  import("//build/util/version.gni")
127  import("//media/cdm/library_cdm/cdm_paths.gni")
128
129  # Template to compile .xib and .storyboard files.
130  #
131  # Arguments
132  #
133  #     sources:
134  #         list of string, sources to compile
135  #
136  #     ibtool_flags:
137  #         (optional) list of string, additional flags to pass to the ibtool
138  template("compile_ib_files") {
139    action_foreach(target_name) {
140      forward_variables_from(invoker,
141                            [
142                              "testonly",
143                              "visibility",
144                            ])
145      assert(defined(invoker.sources),
146            "sources must be specified for $target_name")
147      assert(defined(invoker.output_extension),
148            "output_extension must be specified for $target_name")
149
150      ibtool_flags = []
151      if (defined(invoker.ibtool_flags)) {
152        ibtool_flags = invoker.ibtool_flags
153      }
154
155      _output_extension = invoker.output_extension
156
157      script = "//cef/tools/compile_ib_files.py"
158      sources = invoker.sources
159      outputs = [
160        "$target_gen_dir/$target_name/{{source_name_part}}.$_output_extension",
161      ]
162      args = [
163        "--input",
164        "{{source}}",
165        "--output",
166        rebase_path(
167            "$target_gen_dir/$target_name/{{source_name_part}}.$_output_extension",
168            root_build_dir),
169      ]
170      if (!use_system_xcode) {
171        args += [
172          "--developer_dir",
173          hermetic_xcode_path,
174        ]
175      }
176      args += ibtool_flags
177    }
178  }
179
180  # Template to compile and package Mac XIB files as bundle data.
181  #
182  # Arguments
183  #
184  #     sources:
185  #         list of string, sources to comiple
186  #
187  #     output_path:
188  #         (optional) string, the path to use for the outputs list in the
189  #         bundle_data step. If unspecified, defaults to bundle_resources_dir.
190  template("mac_xib_bundle_data") {
191    _target_name = target_name
192    _compile_target_name = _target_name + "_compile_ibtool"
193
194    compile_ib_files(_compile_target_name) {
195      forward_variables_from(invoker, [ "testonly" ])
196      visibility = [ ":$_target_name" ]
197      sources = invoker.sources
198      output_extension = "nib"
199      ibtool_flags = [
200        "--minimum-deployment-target",
201        mac_deployment_target,
202
203        # TODO(rsesek): Enable this once all the bots are on Xcode 7+.
204        # "--target-device",
205        # "mac",
206      ]
207    }
208
209    bundle_data(_target_name) {
210      forward_variables_from(invoker,
211                            [
212                              "testonly",
213                              "visibility",
214                            ])
215
216      public_deps = [
217        ":$_compile_target_name",
218      ]
219      sources = get_target_outputs(":$_compile_target_name")
220
221      _output_path = "{{bundle_resources_dir}}"
222      if (defined(invoker.output_path)) {
223        _output_path = invoker.output_path
224      }
225
226      outputs = [
227        "$_output_path/{{source_file_part}}",
228      ]
229    }
230  }
231}
232if (is_win) {
233  import("//build/config/win/console_app.gni")
234  import("//build/config/win/manifest.gni")
235}
236
237if (is_linux) {
238  declare_args() {
239    # The cefclient target depends on GTK packages that are not available in the
240    # default sysroot environment. So we should only use them when we are not
241    # using the sysroot. Alternatively, the developer might not want to use the
242    # GTK dependencies at all, in which case they can set `cef_use_gtk=false`.
243    cef_use_gtk = !use_sysroot
244  }
245}
246
247#
248# Verify required global arguments configured via `gn args`.
249# Set by GetRequiredArgs() in //cef/tools/gn_args.py.
250#
251
252# Set ENABLE_PRINTING=1 ENABLE_BASIC_PRINTING=1.
253assert(enable_basic_printing)
254assert(enable_print_preview)
255
256# Enable support for Widevine CDM.
257assert(enable_widevine)
258
259if (is_clang) {
260  # Don't use the chrome style plugin.
261  assert(!clang_use_chrome_plugins)
262}
263
264
265#
266# Local variables.
267#
268
269if (is_mac) {
270  # The tweak_info_plist.py script requires a version number with 4 parts. CEF
271  # uses a version number with 3 parts so just set the last part to 0.
272  cef_plist_version = exec_script(
273    "//cef/tools/cef_version.py", [ "plist" ], "trim string", [])
274
275  # Need to be creative to match dylib version formatting requirements.
276  cef_dylib_version = exec_script(
277    "//cef/tools/cef_version.py", [ "dylib" ], "trim string", [])
278}
279
280# Read file lists from gypi files. The gypi_to_gn.py script does not support
281# variable references so all required variables must be explicitly specified in
282# the below configurations.
283gypi_paths = exec_script("//cef/tools/gypi_to_gn.py",
284                         [ rebase_path("cef_paths.gypi") ],
285                         "scope",
286                         [ "cef_paths.gypi" ])
287gypi_paths2 = exec_script("//cef/tools/gypi_to_gn.py",
288                          [ rebase_path("cef_paths2.gypi") ],
289                          "scope",
290                          [ "cef_paths2.gypi" ])
291
292includes_common = gypi_paths2.includes_common + gypi_paths2.includes_common_capi
293includes_mac = gypi_paths2.includes_mac + gypi_paths2.includes_mac_capi
294includes_linux = gypi_paths2.includes_linux + gypi_paths2.includes_linux_capi
295includes_win = gypi_paths2.includes_win + gypi_paths2.includes_win_capi
296
297#
298# Targets that will be built when depending on "//cef".
299#
300
301group("cef") {
302  testonly = true
303  deps = [
304    ":cefsimple",
305    ":ceftests",
306    ":libcef_static_unittests",
307  ]
308
309  if (!is_linux || use_x11) {
310    deps += [ ":cefclient" ]
311  }
312}
313
314
315#
316# libcef static target.
317#
318
319if (is_win) {
320  # Target for building code that accesses chrome_elf internals. Included from
321  # the //chrome_elf:crash target. Defined as a static_library instead of a
322  # source_set because (a) the source files don't export any symbols and (b)
323  # *_switches.cc duplication otherwise causes linker errors.
324  static_library("chrome_elf_set") {
325    sources = [
326      "libcef/common/crash_reporter_client.cc",
327      "libcef/common/crash_reporter_client.h",
328
329      # Required for crash_keys::GetChromeCrashKeys.
330      # Otherwise we need to copy this array into CEF, which would be difficult
331      # to maintain.
332      "//chrome/common/crash_keys.cc",
333      "//chrome/common/chrome_switches.cc",
334      "//components/flags_ui/flags_ui_switches.cc",
335      "//content/public/common/content_switches.cc",
336    ]
337
338    configs += [
339      "libcef/features:config",
340      "//build/config:precompiled_headers",
341    ]
342
343    if (is_component_build) {
344      # Avoid linker errors with content_switches.cc in component build by not
345      # defining CONTENT_EXPORT.
346      defines = ["COMPILE_CONTENT_STATICALLY"]
347    }
348
349    deps = [
350      "//components/crash/core/common",  # crash_keys
351
352      # Required by chrome_switches.cc
353      "//chrome/common:buildflags",
354      "//ppapi/buildflags:buildflags",
355      "//printing/buildflags:buildflags",
356      "//ui/base:buildflags",
357
358      # Required by content_switches.cc
359      "//media:media_buildflags",
360    ]
361  }
362}
363
364# libcef_static source files that have unit tests.
365source_set("libcef_static_unittested") {
366  sources = [
367    "libcef/browser/devtools/devtools_util.cc",
368    "libcef/browser/devtools/devtools_util.h",
369  ]
370
371  deps = [
372    "//base",
373  ]
374
375  configs += [
376    "libcef/features:config",
377    "//build/config:precompiled_headers",
378  ]
379}
380
381# Executable target for libcef_static unit tests.
382test("libcef_static_unittests") {
383  sources = [
384    "libcef/browser/devtools/devtools_util_unittest.cc",
385  ]
386
387  deps = [
388    ":libcef_static_unittested",
389    "//base/test:run_all_unittests",
390    "//testing/gtest",
391  ]
392
393  configs += [
394    "libcef/features:config",
395    "//build/config:precompiled_headers",
396  ]
397}
398
399static_library("libcef_static") {
400  sources = includes_common +
401            gypi_paths.autogen_cpp_includes + [
402    "libcef/browser/alloy/alloy_browser_context.cc",
403    "libcef/browser/alloy/alloy_browser_context.h",
404    "libcef/browser/alloy/alloy_browser_host_impl.cc",
405    "libcef/browser/alloy/alloy_browser_host_impl.h",
406    "libcef/browser/alloy/alloy_browser_main.cc",
407    "libcef/browser/alloy/alloy_browser_main.h",
408    "libcef/browser/alloy/browser_platform_delegate_alloy.cc",
409    "libcef/browser/alloy/browser_platform_delegate_alloy.h",
410    "libcef/browser/alloy/chrome_browser_process_alloy.cc",
411    "libcef/browser/alloy/chrome_browser_process_alloy.h",
412    "libcef/browser/alloy/chrome_profile_manager_alloy.cc",
413    "libcef/browser/alloy/chrome_profile_manager_alloy.h",
414    "libcef/browser/alloy/chrome_profile_alloy.cc",
415    "libcef/browser/alloy/chrome_profile_alloy.h",
416    "libcef/browser/alloy/alloy_content_browser_client.cc",
417    "libcef/browser/alloy/alloy_content_browser_client.h",
418    "libcef/browser/audio_capturer.cc",
419    "libcef/browser/audio_capturer.h",
420    "libcef/browser/audio_loopback_stream_creator.cc",
421    "libcef/browser/audio_loopback_stream_creator.h",
422    "libcef/browser/browser_contents_delegate.cc",
423    "libcef/browser/browser_contents_delegate.h",
424    "libcef/browser/browser_context.cc",
425    "libcef/browser/browser_context.h",
426    "libcef/browser/browser_context_keyed_service_factories.cc",
427    "libcef/browser/browser_context_keyed_service_factories.h",
428    "libcef/browser/browser_host_base.cc",
429    "libcef/browser/browser_host_base.h",
430    "libcef/browser/browser_host_create.cc",
431    "libcef/browser/browser_info.cc",
432    "libcef/browser/browser_info.h",
433    "libcef/browser/browser_info_manager.cc",
434    "libcef/browser/browser_info_manager.h",
435    "libcef/browser/browser_message_filter.cc",
436    "libcef/browser/browser_message_filter.h",
437    "libcef/browser/browser_message_loop.cc",
438    "libcef/browser/browser_message_loop.h",
439    "libcef/browser/browser_platform_delegate.cc",
440    "libcef/browser/browser_platform_delegate.h",
441    "libcef/browser/browser_platform_delegate_create.cc",
442    "libcef/browser/browser_util.cc",
443    "libcef/browser/browser_util.h",
444    "libcef/browser/chrome/browser_delegate.h",
445    "libcef/browser/chrome/browser_platform_delegate_chrome.cc",
446    "libcef/browser/chrome/browser_platform_delegate_chrome.h",
447    "libcef/browser/chrome/chrome_browser_context.cc",
448    "libcef/browser/chrome/chrome_browser_context.h",
449    "libcef/browser/chrome/chrome_browser_delegate.cc",
450    "libcef/browser/chrome/chrome_browser_delegate.h",
451    "libcef/browser/chrome/chrome_browser_host_impl.cc",
452    "libcef/browser/chrome/chrome_browser_host_impl.h",
453    "libcef/browser/chrome/chrome_browser_main_extra_parts_cef.cc",
454    "libcef/browser/chrome/chrome_browser_main_extra_parts_cef.h",
455    "libcef/browser/chrome/chrome_content_browser_client_cef.cc",
456    "libcef/browser/chrome/chrome_content_browser_client_cef.h",
457    "libcef/browser/chrome/chrome_context_menu_handler.cc",
458    "libcef/browser/chrome/chrome_context_menu_handler.h",
459    "libcef/browser/chrome_crash_reporter_client_stub.cc",
460    "libcef/browser/context.cc",
461    "libcef/browser/context.h",
462    "libcef/browser/context_menu_params_impl.cc",
463    "libcef/browser/context_menu_params_impl.h",
464    "libcef/browser/devtools/devtools_controller.cc",
465    "libcef/browser/devtools/devtools_controller.h",
466    "libcef/browser/devtools/devtools_file_manager.cc",
467    "libcef/browser/devtools/devtools_file_manager.h",
468    "libcef/browser/devtools/devtools_frontend.cc",
469    "libcef/browser/devtools/devtools_frontend.h",
470    "libcef/browser/devtools/devtools_manager.cc",
471    "libcef/browser/devtools/devtools_manager.h",
472    "libcef/browser/devtools/devtools_manager_delegate.cc",
473    "libcef/browser/devtools/devtools_manager_delegate.h",
474    "libcef/browser/download_item_impl.cc",
475    "libcef/browser/download_item_impl.h",
476    "libcef/browser/download_manager_delegate.cc",
477    "libcef/browser/download_manager_delegate.h",
478    "libcef/browser/extension_impl.cc",
479    "libcef/browser/extension_impl.h",
480    "libcef/browser/extensions/api/storage/sync_value_store_cache.cc",
481    "libcef/browser/extensions/api/storage/sync_value_store_cache.h",
482    "libcef/browser/extensions/api/tabs/tabs_api.cc",
483    "libcef/browser/extensions/api/tabs/tabs_api.h",
484    "libcef/browser/extensions/alloy_extensions_util.cc",
485    "libcef/browser/extensions/alloy_extensions_util.h",
486    "libcef/browser/extensions/browser_extensions_util.cc",
487    "libcef/browser/extensions/browser_extensions_util.h",
488    "libcef/browser/extensions/browser_platform_delegate_background.cc",
489    "libcef/browser/extensions/browser_platform_delegate_background.h",
490    "libcef/browser/extensions/chrome_api_registration.cc",
491    "libcef/browser/extensions/chrome_api_registration.h",
492    "libcef/browser/extensions/component_extension_resource_manager.cc",
493    "libcef/browser/extensions/component_extension_resource_manager.h",
494    "libcef/browser/extensions/extensions_api_client.cc",
495    "libcef/browser/extensions/extensions_api_client.h",
496    "libcef/browser/extensions/extensions_browser_api_provider.cc",
497    "libcef/browser/extensions/extensions_browser_api_provider.h",
498    "libcef/browser/extensions/extensions_browser_client.cc",
499    "libcef/browser/extensions/extensions_browser_client.h",
500    "libcef/browser/extensions/extension_background_host.cc",
501    "libcef/browser/extensions/extension_background_host.h",
502    "libcef/browser/extensions/extension_function_details.cc",
503    "libcef/browser/extensions/extension_function_details.h",
504    "libcef/browser/extensions/extension_host_delegate.cc",
505    "libcef/browser/extensions/extension_host_delegate.h",
506    "libcef/browser/extensions/extension_system.cc",
507    "libcef/browser/extensions/extension_system.h",
508    "libcef/browser/extensions/extension_system_factory.cc",
509    "libcef/browser/extensions/extension_system_factory.h",
510    "libcef/browser/extensions/extension_view_host.cc",
511    "libcef/browser/extensions/extension_view_host.h",
512    "libcef/browser/extensions/extension_web_contents_observer.cc",
513    "libcef/browser/extensions/extension_web_contents_observer.h",
514    "libcef/browser/extensions/mime_handler_view_guest_delegate.cc",
515    "libcef/browser/extensions/mime_handler_view_guest_delegate.h",
516    "libcef/browser/extensions/pdf_extension_util.cc",
517    "libcef/browser/extensions/pdf_extension_util.h",
518    "libcef/browser/extensions/pdf_web_contents_helper_client.cc",
519    "libcef/browser/extensions/pdf_web_contents_helper_client.h",
520    "libcef/browser/extensions/value_store/cef_value_store.cc",
521    "libcef/browser/extensions/value_store/cef_value_store.h",
522    "libcef/browser/extensions/value_store/cef_value_store_factory.cc",
523    "libcef/browser/extensions/value_store/cef_value_store_factory.h",
524    "libcef/browser/file_dialog_runner.h",
525    "libcef/browser/file_dialog_manager.cc",
526    "libcef/browser/file_dialog_manager.h",
527    "libcef/browser/frame_host_impl.cc",
528    "libcef/browser/frame_host_impl.h",
529    "libcef/browser/image_impl.cc",
530    "libcef/browser/image_impl.h",
531    "libcef/browser/iothread_state.cc",
532    "libcef/browser/iothread_state.h",
533    "libcef/browser/javascript_dialog_runner.h",
534    "libcef/browser/javascript_dialog_manager.cc",
535    "libcef/browser/javascript_dialog_manager.h",
536    "libcef/browser/main_runner.cc",
537    "libcef/browser/main_runner.h",
538    "libcef/browser/media_capture_devices_dispatcher.cc",
539    "libcef/browser/media_capture_devices_dispatcher.h",
540    "libcef/browser/media_router/media_route_impl.cc",
541    "libcef/browser/media_router/media_route_impl.h",
542    "libcef/browser/media_router/media_router_impl.cc",
543    "libcef/browser/media_router/media_router_impl.h",
544    "libcef/browser/media_router/media_router_manager.cc",
545    "libcef/browser/media_router/media_router_manager.h",
546    "libcef/browser/media_router/media_sink_impl.cc",
547    "libcef/browser/media_router/media_sink_impl.h",
548    "libcef/browser/media_router/media_source_impl.cc",
549    "libcef/browser/media_router/media_source_impl.h",
550    "libcef/browser/menu_manager.cc",
551    "libcef/browser/menu_manager.h",
552    "libcef/browser/menu_model_impl.cc",
553    "libcef/browser/menu_model_impl.h",
554    "libcef/browser/menu_runner.h",
555    "libcef/browser/native/browser_platform_delegate_native.cc",
556    "libcef/browser/native/browser_platform_delegate_native.h",
557    "libcef/browser/native/cursor_util.h",
558    "libcef/browser/native/cursor_util.cc",
559    "libcef/browser/navigate_params.cc",
560    "libcef/browser/navigate_params.h",
561    "libcef/browser/navigation_entry_impl.cc",
562    "libcef/browser/navigation_entry_impl.h",
563    "libcef/browser/net/chrome_scheme_handler.cc",
564    "libcef/browser/net/chrome_scheme_handler.h",
565    "libcef/browser/net/crlset_file_util_impl.cc",
566    "libcef/browser/net/devtools_scheme_handler.cc",
567    "libcef/browser/net/devtools_scheme_handler.h",
568    "libcef/browser/net/internal_scheme_handler.cc",
569    "libcef/browser/net/internal_scheme_handler.h",
570    "libcef/browser/net/scheme_handler.cc",
571    "libcef/browser/net/scheme_handler.h",
572    "libcef/browser/net/throttle_handler.cc",
573    "libcef/browser/net/throttle_handler.h",
574    "libcef/browser/net_service/browser_urlrequest_impl.cc",
575    "libcef/browser/net_service/browser_urlrequest_impl.h",
576    "libcef/browser/net_service/cookie_helper.cc",
577    "libcef/browser/net_service/cookie_helper.h",
578    "libcef/browser/net_service/cookie_manager_impl.cc",
579    "libcef/browser/net_service/cookie_manager_impl.h",
580    "libcef/browser/net_service/login_delegate.cc",
581    "libcef/browser/net_service/login_delegate.h",
582    "libcef/browser/net_service/proxy_url_loader_factory.cc",
583    "libcef/browser/net_service/proxy_url_loader_factory.h",
584    "libcef/browser/net_service/resource_handler_wrapper.cc",
585    "libcef/browser/net_service/resource_handler_wrapper.h",
586    "libcef/browser/net_service/resource_request_handler_wrapper.cc",
587    "libcef/browser/net_service/resource_request_handler_wrapper.h",
588    "libcef/browser/net_service/response_filter_wrapper.cc",
589    "libcef/browser/net_service/response_filter_wrapper.h",
590    "libcef/browser/net_service/stream_reader_url_loader.cc",
591    "libcef/browser/net_service/stream_reader_url_loader.h",
592    "libcef/browser/net_service/url_loader_factory_getter.cc",
593    "libcef/browser/net_service/url_loader_factory_getter.h",
594    "libcef/browser/origin_whitelist_impl.cc",
595    "libcef/browser/origin_whitelist_impl.h",
596    "libcef/browser/osr/browser_platform_delegate_osr.cc",
597    "libcef/browser/osr/browser_platform_delegate_osr.h",
598    "libcef/browser/osr/host_display_client_osr.cc",
599    "libcef/browser/osr/host_display_client_osr.h",
600    "libcef/browser/osr/motion_event_osr.cc",
601    "libcef/browser/osr/motion_event_osr.h",
602    "libcef/browser/osr/osr_accessibility_util.cc",
603    "libcef/browser/osr/osr_accessibility_util.h",
604    "libcef/browser/osr/osr_util.cc",
605    "libcef/browser/osr/osr_util.h",
606    "libcef/browser/osr/render_widget_host_view_osr.cc",
607    "libcef/browser/osr/render_widget_host_view_osr.h",
608    "libcef/browser/osr/synthetic_gesture_target_osr.cc",
609    "libcef/browser/osr/synthetic_gesture_target_osr.h",
610    "libcef/browser/osr/video_consumer_osr.cc",
611    "libcef/browser/osr/video_consumer_osr.h",
612    "libcef/browser/osr/web_contents_view_osr.cc",
613    "libcef/browser/osr/web_contents_view_osr.h",
614    "libcef/browser/path_util_impl.cc",
615    "libcef/browser/plugins/plugin_service_filter.cc",
616    "libcef/browser/plugins/plugin_service_filter.h",
617    "libcef/browser/prefs/browser_prefs.cc",
618    "libcef/browser/prefs/browser_prefs.h",
619    "libcef/browser/prefs/pref_store.cc",
620    "libcef/browser/prefs/pref_store.h",
621    "libcef/browser/prefs/renderer_prefs.cc",
622    "libcef/browser/prefs/renderer_prefs.h",
623    "libcef/browser/print_settings_impl.cc",
624    "libcef/browser/print_settings_impl.h",
625    "libcef/browser/printing/constrained_window_views_client.cc",
626    "libcef/browser/printing/constrained_window_views_client.h",
627    "libcef/browser/printing/print_view_manager.cc",
628    "libcef/browser/printing/print_view_manager.h",
629    "libcef/browser/process_util_impl.cc",
630    "libcef/browser/request_context_handler_map.cc",
631    "libcef/browser/request_context_handler_map.h",
632    "libcef/browser/request_context_impl.cc",
633    "libcef/browser/request_context_impl.h",
634    "libcef/browser/scheme_impl.cc",
635    "libcef/browser/server_impl.cc",
636    "libcef/browser/server_impl.h",
637    "libcef/browser/simple_menu_model_impl.cc",
638    "libcef/browser/simple_menu_model_impl.h",
639    "libcef/browser/speech_recognition_manager_delegate.cc",
640    "libcef/browser/speech_recognition_manager_delegate.h",
641    "libcef/browser/ssl_host_state_delegate.cc",
642    "libcef/browser/ssl_host_state_delegate.h",
643    "libcef/browser/ssl_info_impl.cc",
644    "libcef/browser/ssl_info_impl.h",
645    "libcef/browser/ssl_status_impl.cc",
646    "libcef/browser/ssl_status_impl.h",
647    "libcef/browser/stream_impl.cc",
648    "libcef/browser/stream_impl.h",
649    "libcef/browser/trace_impl.cc",
650    "libcef/browser/trace_subscriber.cc",
651    "libcef/browser/trace_subscriber.h",
652    "libcef/browser/thread_util.h",
653    "libcef/browser/web_contents_dialog_helper.cc",
654    "libcef/browser/web_contents_dialog_helper.h",
655    "libcef/browser/web_plugin_impl.cc",
656    "libcef/browser/web_plugin_impl.h",
657    "libcef/browser/x509_certificate_impl.cc",
658    "libcef/browser/x509_certificate_impl.h",
659    "libcef/browser/x509_cert_principal_impl.cc",
660    "libcef/browser/x509_cert_principal_impl.h",
661    "libcef/browser/xml_reader_impl.cc",
662    "libcef/browser/xml_reader_impl.h",
663    "libcef/browser/zip_reader_impl.cc",
664    "libcef/browser/zip_reader_impl.h",
665    "libcef/common/alloy/alloy_content_client.cc",
666    "libcef/common/alloy/alloy_content_client.h",
667    "libcef/common/alloy/alloy_main_delegate.cc",
668    "libcef/common/alloy/alloy_main_delegate.h",
669    "libcef/common/alloy/alloy_main_runner_delegate.cc",
670    "libcef/common/alloy/alloy_main_runner_delegate.h",
671    "libcef/common/app_manager.cc",
672    "libcef/common/app_manager.h",
673    "libcef/common/base_impl.cc",
674    "libcef/common/cef_message_generator.cc",
675    "libcef/common/cef_message_generator.h",
676    "libcef/common/cef_messages.cc",
677    "libcef/common/cef_messages.h",
678    "libcef/common/cef_switches.cc",
679    "libcef/common/cef_switches.h",
680    "libcef/common/chrome/chrome_content_client_cef.cc",
681    "libcef/common/chrome/chrome_content_client_cef.h",
682    "libcef/common/chrome/chrome_main_delegate_cef.cc",
683    "libcef/common/chrome/chrome_main_delegate_cef.h",
684    "libcef/common/chrome/chrome_main_runner_delegate.cc",
685    "libcef/common/chrome/chrome_main_runner_delegate.h",
686    "libcef/common/command_line_impl.cc",
687    "libcef/common/command_line_impl.h",
688    "libcef/common/crash_reporter_client.cc",
689    "libcef/common/crash_reporter_client.h",
690    "libcef/common/crash_reporting.cc",
691    "libcef/common/crash_reporting.h",
692    "libcef/common/drag_data_impl.cc",
693    "libcef/common/drag_data_impl.h",
694    "libcef/common/extensions/chrome_generated_schemas.cc",
695    "libcef/common/extensions/chrome_generated_schemas.h",
696    "libcef/common/extensions/extensions_api_provider.cc",
697    "libcef/common/extensions/extensions_api_provider.h",
698    "libcef/common/extensions/extensions_client.cc",
699    "libcef/common/extensions/extensions_client.h",
700    "libcef/common/extensions/extensions_util.cc",
701    "libcef/common/extensions/extensions_util.h",
702    "libcef/common/file_util_impl.cc",
703    "libcef/common/frame_util.cc",
704    "libcef/common/frame_util.h",
705    "libcef/common/json_impl.cc",
706    "libcef/common/main_runner_delegate.h",
707    "libcef/common/main_runner_handler.h",
708    "libcef/common/net/http_header_utils.cc",
709    "libcef/common/net/http_header_utils.h",
710    "libcef/common/net/net_resource_provider.cc",
711    "libcef/common/net/net_resource_provider.h",
712    "libcef/common/net/scheme_registration.cc",
713    "libcef/common/net/scheme_registration.h",
714    "libcef/common/net/upload_data.cc",
715    "libcef/common/net/upload_data.h",
716    "libcef/common/net/upload_element.cc",
717    "libcef/common/net/upload_element.h",
718    "libcef/common/net/url_util.cc",
719    "libcef/common/net/url_util.h",
720    "libcef/common/net_service/net_service_util.cc",
721    "libcef/common/net_service/net_service_util.h",
722    "libcef/common/parser_impl.cc",
723    "libcef/common/process_message_impl.cc",
724    "libcef/common/process_message_impl.h",
725    "libcef/common/request_impl.cc",
726    "libcef/common/request_impl.h",
727    "libcef/common/resource_bundle_delegate.cc",
728    "libcef/common/resource_bundle_delegate.h",
729    "libcef/common/resource_bundle_impl.cc",
730    "libcef/common/resource_bundle_impl.h",
731    "libcef/common/resource_util.cc",
732    "libcef/common/resource_util.h",
733    "libcef/common/response_impl.cc",
734    "libcef/common/response_impl.h",
735    "libcef/common/response_manager.cc",
736    "libcef/common/response_manager.h",
737    "libcef/common/scheme_registrar_impl.cc",
738    "libcef/common/scheme_registrar_impl.h",
739    "libcef/common/string_list_impl.cc",
740    "libcef/common/string_map_impl.cc",
741    "libcef/common/string_multimap_impl.cc",
742    "libcef/common/string_types_impl.cc",
743    "libcef/common/task_impl.cc",
744    "libcef/common/task_runner_impl.cc",
745    "libcef/common/task_runner_impl.h",
746    "libcef/common/task_runner_manager.cc",
747    "libcef/common/task_runner_manager.h",
748    "libcef/common/test/translator_test_impl.cc",
749    "libcef/common/thread_impl.cc",
750    "libcef/common/thread_impl.h",
751    "libcef/common/time_impl.cc",
752    "libcef/common/time_util.h",
753    "libcef/common/tracker.cc",
754    "libcef/common/tracker.h",
755    "libcef/common/urlrequest_impl.cc",
756    "libcef/common/value_base.cc",
757    "libcef/common/value_base.h",
758    "libcef/common/values_impl.cc",
759    "libcef/common/values_impl.h",
760    "libcef/common/waitable_event_impl.cc",
761    "libcef/common/waitable_event_impl.h",
762    "libcef/common/widevine_loader.cc",
763    "libcef/common/widevine_loader.h",
764    "libcef/features/runtime.h",
765    "libcef/features/runtime_checks.h",
766    "libcef/renderer/alloy/alloy_content_renderer_client.cc",
767    "libcef/renderer/alloy/alloy_content_renderer_client.h",
768    "libcef/renderer/alloy/alloy_render_frame_observer.cc",
769    "libcef/renderer/alloy/alloy_render_frame_observer.h",
770    "libcef/renderer/alloy/alloy_render_thread_observer.cc",
771    "libcef/renderer/alloy/alloy_render_thread_observer.h",
772    "libcef/renderer/alloy/url_loader_throttle_provider_impl.cc",
773    "libcef/renderer/alloy/url_loader_throttle_provider_impl.h",
774    "libcef/renderer/browser_impl.cc",
775    "libcef/renderer/browser_impl.h",
776    "libcef/renderer/browser_manager.cc",
777    "libcef/renderer/browser_manager.h",
778    "libcef/renderer/chrome/chrome_content_renderer_client_cef.cc",
779    "libcef/renderer/chrome/chrome_content_renderer_client_cef.h",
780    "libcef/renderer/dom_document_impl.cc",
781    "libcef/renderer/dom_document_impl.h",
782    "libcef/renderer/dom_node_impl.cc",
783    "libcef/renderer/dom_node_impl.h",
784    "libcef/renderer/extensions/extensions_dispatcher_delegate.cc",
785    "libcef/renderer/extensions/extensions_dispatcher_delegate.h",
786    "libcef/renderer/extensions/extensions_renderer_client.cc",
787    "libcef/renderer/extensions/extensions_renderer_client.h",
788    "libcef/renderer/extensions/print_render_frame_helper_delegate.cc",
789    "libcef/renderer/extensions/print_render_frame_helper_delegate.h",
790    "libcef/renderer/frame_impl.cc",
791    "libcef/renderer/frame_impl.h",
792    "libcef/renderer/render_frame_observer.cc",
793    "libcef/renderer/render_frame_observer.h",
794    "libcef/renderer/render_frame_util.cc",
795    "libcef/renderer/render_frame_util.h",
796    "libcef/renderer/render_thread_observer.cc",
797    "libcef/renderer/render_thread_observer.h",
798    "libcef/renderer/render_urlrequest_impl.cc",
799    "libcef/renderer/render_urlrequest_impl.h",
800    "libcef/renderer/thread_util.h",
801    "libcef/renderer/v8_impl.cc",
802    "libcef/renderer/v8_impl.h",
803
804    # For Chrome runtime support.
805    "//chrome/app/chrome_main_delegate.cc",
806    "//chrome/app/chrome_main_delegate.h",
807  ]
808
809  configs += [
810    "libcef/features:config",
811    "//build/config:precompiled_headers",
812
813    # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
814    "//build/config/compiler:no_size_t_to_int_warning",
815  ]
816
817  public_configs = [
818    "libcef/features:config",
819  ]
820
821  include_dirs = [
822    # Crashpad code uses paths relative to this directory.
823    "//third_party/crashpad/crashpad",
824  ]
825
826  public_deps = [
827    # Bring in feature flag defines.
828    "//cef/libcef/features",
829  ]
830
831  deps = [
832    ":cef_make_headers",
833
834    ":libcef_static_unittested",
835
836    # Generate API bindings for extensions.
837    # TODO(cef): Enable if/when CEF exposes its own Mojo APIs. See
838    # libcef/common/extensions/api/README.txt for details.
839    #"libcef/common/extensions/api",
840    #"libcef/common/extensions/api:api_registration",
841    "libcef/common/extensions/api:extensions_features",
842
843    # Normal build dependencies. Should be sorted alphabetically.
844    "//base",
845    "//base:base_static",
846    "//base/third_party/dynamic_annotations",
847    "//cc",
848    "//chrome:browser_dependencies",
849    "//chrome:child_dependencies",
850    "//chrome:packed_resources",
851    "//chrome:resources",
852    "//chrome:strings",
853    "//chrome/common:buildflags",
854    "//chrome/services/printing:lib",
855    "//components/cdm/renderer",
856    "//components/certificate_transparency",
857    "//components/content_settings/core/browser",
858    "//components/content_settings/core/common",
859    "//components/crx_file",
860    "//components/data_use_measurement/core",
861    "//components/google/core/common",
862    "//components/keyed_service/content:content",
863    "//components/keyed_service/core:core",
864    "//components/media_router/common/mojom:media_router",
865    "//components/navigation_interception",
866    "//components/network_session_configurator/common",
867    "//components/pdf/browser",
868    "//components/pdf/renderer",
869    "//components/plugins/renderer",
870    "//components/pref_registry",
871    "//components/printing/browser",
872    "//components/printing/common",
873    "//components/printing/renderer",
874    "//components/proxy_config",
875    "//components/safe_browsing/core/db:test_database_manager",
876    "//components/services/print_compositor/public/cpp",
877    "//components/services/print_compositor/public/mojom",
878    "//components/update_client",
879    "//components/url_formatter",
880    "//components/user_prefs",
881    "//components/version_info",
882    "//components/visitedlink/browser",
883    "//components/visitedlink/common",
884    "//components/visitedlink/renderer",
885    "//components/viz/service",
886    "//components/web_cache/renderer",
887    "//content/public/app",
888    "//content/public/browser",
889    "//content/public/child",
890    "//content/public/common",
891    "//content/public/gpu",
892    "//content/public/renderer",
893    "//content/public/utility",
894    "//crypto",
895    "//device/base",
896    "//extensions/browser",
897    "//extensions/browser:core_api_provider",
898    "//extensions/buildflags",
899    "//extensions/common/api",
900    "//extensions/common:core_api_provider",
901    "//extensions/renderer",
902    "//gpu",
903    "//ipc",
904    "//media",
905    "//media/blink",
906    "//net",
907    "//pdf",
908    "//ppapi/buildflags",
909    "//printing/buildflags",
910    "//services/network:network_service",
911    "//services/network/public/cpp",
912    "//services/service_manager/public/cpp",
913    "//skia",
914    "//storage/browser",
915    "//third_party/blink/public:blink",
916    "//third_party/brotli:dec",
917    "//third_party/cld_3/src/src:cld_3",
918    "//third_party/hunspell",
919    "//third_party/leveldatabase",
920    "//third_party/libxml:libxml",
921    "//third_party/widevine/cdm:headers",
922    "//third_party/widevine/cdm",
923    "//third_party/icu",
924    "//third_party/zlib:minizip",
925    "//ui/base",
926    "//ui/base/ime",
927    "//ui/events:events_base",
928    "//ui/gfx",
929    "//ui/gfx/geometry",
930    "//ui/gfx/ipc",
931    "//ui/gfx/ipc/geometry",
932    "//ui/gfx/ipc/skia",
933    "//ui/gl",
934    "//url",
935    "//v8",
936  ]
937
938  if (is_win) {
939    sources += includes_win + [
940      "libcef/browser/alloy/alloy_browser_main_win.cc",
941      "libcef/browser/native/browser_platform_delegate_native_win.cc",
942      "libcef/browser/native/browser_platform_delegate_native_win.h",
943      "libcef/browser/native/cursor_util_win.cc",
944      "libcef/browser/native/file_dialog_runner_win.cc",
945      "libcef/browser/native/file_dialog_runner_win.h",
946      "libcef/browser/native/javascript_dialog_runner_win.cc",
947      "libcef/browser/native/javascript_dialog_runner_win.h",
948      "libcef/browser/native/menu_2.cc",
949      "libcef/browser/native/menu_2.h",
950      "libcef/browser/native/menu_runner_win.cc",
951      "libcef/browser/native/menu_runner_win.h",
952      "libcef/browser/native/menu_wrapper.h",
953      "libcef/browser/native/native_menu_win.cc",
954      "libcef/browser/native/native_menu_win.h",
955      "libcef/browser/osr/browser_platform_delegate_osr_win.cc",
956      "libcef/browser/osr/browser_platform_delegate_osr_win.h",
957
958      # Part of //chrome/utility.
959      "//chrome/utility/printing_handler.cc",
960      "//chrome/utility/printing_handler.h",
961    ]
962
963    deps += [
964      "//chrome/install_static:secondary_module",
965      "//chrome/chrome_elf",
966    ]
967
968    if (is_component_build) {
969      deps += [ "//content:sandbox_helper_win" ]
970    }
971
972    libs = [
973      "comctl32.lib",
974      # For D3D11_DECODER_PROFILE_H264_VLD_NOFGT.
975      "dxguid.lib",
976    ]
977
978    data_deps = [
979      "//chrome/elevation_service",
980    ]
981  }
982
983  if (is_linux) {
984    sources += includes_linux + [
985      "libcef/browser/native/browser_platform_delegate_native_linux.cc",
986      "libcef/browser/native/browser_platform_delegate_native_linux.h",
987      "libcef/browser/native/cursor_util_linux.cc",
988      "libcef/browser/native/menu_runner_linux.cc",
989      "libcef/browser/native/menu_runner_linux.h",
990      "libcef/browser/osr/browser_platform_delegate_osr_linux.cc",
991      "libcef/browser/osr/browser_platform_delegate_osr_linux.h",
992      "libcef/browser/printing/print_dialog_linux.cc",
993      "libcef/browser/printing/print_dialog_linux.h",
994    ]
995
996    if (use_x11) {
997      sources += [
998        "libcef/browser/native/window_x11.cc",
999        "libcef/browser/native/window_x11.h",
1000      ]
1001    }
1002
1003    deps += [
1004      "//build/config/freetype",
1005      "//third_party/fontconfig",
1006    ]
1007
1008    if (is_linux && !use_x11) {
1009      deps += [
1010        "//third_party/angle:libEGL",
1011      ]
1012    }
1013  }
1014
1015  if (is_mac) {
1016    sources += includes_mac + [
1017      "libcef/browser/native/browser_platform_delegate_native_mac.h",
1018      "libcef/browser/native/browser_platform_delegate_native_mac.mm",
1019      "libcef/browser/native/file_dialog_runner_mac.h",
1020      "libcef/browser/native/file_dialog_runner_mac.mm",
1021      "libcef/browser/native/javascript_dialog_runner_mac.h",
1022      "libcef/browser/native/javascript_dialog_runner_mac.mm",
1023      "libcef/browser/native/menu_runner_mac.h",
1024      "libcef/browser/native/menu_runner_mac.mm",
1025      "libcef/browser/osr/browser_platform_delegate_osr_mac.h",
1026      "libcef/browser/osr/browser_platform_delegate_osr_mac.mm",
1027      "libcef/common/util_mac.h",
1028      "libcef/common/util_mac.mm",
1029
1030      # For Chrome runtime support.
1031      "//chrome/app/chrome_main_mac.h",
1032      "//chrome/app/chrome_main_mac.mm",
1033    ]
1034  }
1035
1036  if (is_win || is_mac) {
1037    deps += [ "//third_party/crashpad/crashpad/handler" ]
1038  }
1039
1040  if (use_x11) {
1041    deps += [ "//ui/events/devices/x11" ]
1042  }
1043
1044  if (is_posix && !is_mac) {
1045    sources += [
1046      "libcef/common/cef_crash_report_utils.cc",
1047      "libcef/common/cef_crash_report_utils.h",
1048    ]
1049
1050    deps += [
1051      "//components/crash/core/app",
1052      "//components/crash/content/browser",
1053    ]
1054  }
1055
1056  if (v8_use_external_startup_data && use_v8_context_snapshot) {
1057    deps += [ "//tools/v8_context_snapshot" ]
1058  }
1059
1060  if (toolkit_views) {
1061    sources += [
1062      "libcef/browser/chrome/views/browser_platform_delegate_chrome_views.cc",
1063      "libcef/browser/chrome/views/browser_platform_delegate_chrome_views.h",
1064      "libcef/browser/chrome/views/chrome_browser_frame.cc",
1065      "libcef/browser/chrome/views/chrome_browser_frame.h",
1066      "libcef/browser/chrome/views/chrome_browser_view.cc",
1067      "libcef/browser/chrome/views/chrome_browser_view.h",
1068      "libcef/browser/chrome/views/toolbar_view_impl.cc",
1069      "libcef/browser/chrome/views/toolbar_view_impl.h",
1070      "libcef/browser/chrome/views/toolbar_view_view.cc",
1071      "libcef/browser/chrome/views/toolbar_view_view.h",
1072      "libcef/browser/native/window_delegate_view.cc",
1073      "libcef/browser/native/window_delegate_view.h",
1074      "libcef/browser/views/basic_label_button_impl.cc",
1075      "libcef/browser/views/basic_label_button_impl.h",
1076      "libcef/browser/views/basic_label_button_view.cc",
1077      "libcef/browser/views/basic_label_button_view.h",
1078      "libcef/browser/views/basic_panel_impl.cc",
1079      "libcef/browser/views/basic_panel_impl.h",
1080      "libcef/browser/views/basic_panel_view.cc",
1081      "libcef/browser/views/basic_panel_view.h",
1082      "libcef/browser/views/box_layout_impl.cc",
1083      "libcef/browser/views/box_layout_impl.h",
1084      "libcef/browser/views/browser_platform_delegate_views.cc",
1085      "libcef/browser/views/browser_platform_delegate_views.h",
1086      "libcef/browser/views/browser_view_impl.cc",
1087      "libcef/browser/views/browser_view_impl.h",
1088      "libcef/browser/views/browser_view_view.cc",
1089      "libcef/browser/views/browser_view_view.h",
1090      "libcef/browser/views/button_impl.h",
1091      "libcef/browser/views/button_view.h",
1092      "libcef/browser/views/display_impl.cc",
1093      "libcef/browser/views/display_impl.h",
1094      "libcef/browser/views/fill_layout_impl.cc",
1095      "libcef/browser/views/fill_layout_impl.h",
1096      "libcef/browser/views/label_button_impl.h",
1097      "libcef/browser/views/label_button_view.h",
1098      "libcef/browser/views/layout_impl.h",
1099      "libcef/browser/views/layout_adapter.cc",
1100      "libcef/browser/views/layout_adapter.h",
1101      "libcef/browser/views/layout_util.cc",
1102      "libcef/browser/views/layout_util.h",
1103      "libcef/browser/views/menu_button_impl.cc",
1104      "libcef/browser/views/menu_button_impl.h",
1105      "libcef/browser/views/menu_button_view.cc",
1106      "libcef/browser/views/menu_button_view.h",
1107      "libcef/browser/views/menu_runner_views.cc",
1108      "libcef/browser/views/menu_runner_views.h",
1109      "libcef/browser/views/panel_impl.h",
1110      "libcef/browser/views/panel_view.h",
1111      "libcef/browser/views/scroll_view_impl.cc",
1112      "libcef/browser/views/scroll_view_impl.h",
1113      "libcef/browser/views/scroll_view_view.cc",
1114      "libcef/browser/views/scroll_view_view.h",
1115      "libcef/browser/views/textfield_impl.cc",
1116      "libcef/browser/views/textfield_impl.h",
1117      "libcef/browser/views/textfield_view.cc",
1118      "libcef/browser/views/textfield_view.h",
1119      "libcef/browser/views/view_adapter.cc",
1120      "libcef/browser/views/view_adapter.h",
1121      "libcef/browser/views/view_impl.h",
1122      "libcef/browser/views/view_util.cc",
1123      "libcef/browser/views/view_util.h",
1124      "libcef/browser/views/view_view.h",
1125      "libcef/browser/views/window_impl.cc",
1126      "libcef/browser/views/window_impl.h",
1127      "libcef/browser/views/window_view.cc",
1128      "libcef/browser/views/window_view.h",
1129
1130      # Part of //ui/views:test_support which is testingonly.
1131      "//ui/views/test/desktop_test_views_delegate.h",
1132      "//ui/views/test/test_views_delegate.h",
1133
1134      # Support for UI input events.
1135      # Part of //ui/base:test_support which is testingonly.
1136      "//ui/base/test/ui_controls.h",
1137    ]
1138
1139    deps += [
1140      "//ui/events",
1141      "//ui/strings",
1142      "//ui/views",
1143      "//ui/views/controls/webview",
1144    ]
1145
1146    if (use_aura) {
1147      sources += [
1148        "libcef/browser/native/browser_platform_delegate_native_aura.cc",
1149        "libcef/browser/native/browser_platform_delegate_native_aura.h",
1150        "libcef/browser/views/view_util_aura.cc",
1151
1152        # Part of //ui/views:test_support which is testingonly.
1153        "//ui/views/test/desktop_test_views_delegate_aura.cc",
1154        "//ui/views/test/test_views_delegate_aura.cc",
1155
1156        # Support for UI input events.
1157        # Part of //ui/base:test_support which is testingonly.
1158        "//ui/base/test/ui_controls_aura.cc",
1159        "//ui/aura/test/ui_controls_factory_aura.h",
1160      ]
1161
1162      deps += [
1163        "//ui/aura",
1164        "//ui/wm",
1165        "//ui/wm/public",
1166      ]
1167
1168      if (is_win) {
1169        sources += [
1170          # Support for UI input events.
1171          # Part of //base/test:test_config which is testingonly.
1172          "//base/test/test_switches.cc",
1173          "//base/test/test_switches.h",
1174          "//base/test/test_timeouts.cc",
1175          "//base/test/test_timeouts.h",
1176          # Part of //ui/aura:test_support which is testingonly.
1177          "//ui/aura/test/ui_controls_factory_aurawin.cc",
1178          # Part of //ui/base:test_support which is testingonly.
1179          "//ui/base/test/ui_controls_internal_win.cc",
1180          "//ui/base/test/ui_controls_internal_win.h",
1181        ]
1182      }
1183
1184      if (is_linux) {
1185        sources += [
1186          # Support for UI input events.
1187          # Part of //ui/aura:test_support which is testingonly.
1188          "//ui/aura/test/aura_test_utils.cc",
1189          "//ui/aura/test/aura_test_utils.h",
1190          # Part of //ui/events:test_support which is testingonly.
1191          "//ui/events/test/x11_event_waiter.cc",
1192          "//ui/events/test/x11_event_waiter.h",
1193        ]
1194
1195        if (use_x11) {
1196          sources += [
1197            # Support for UI input events.
1198            # Part of //ui/base/x:test_support which is testingonly.
1199            "//ui/base/x/test/x11_ui_controls_test_helper.cc",
1200            "//ui/base/x/test/x11_ui_controls_test_helper.h",
1201            # Part of //ui/aura:test_support which is testingonly.
1202            "//ui/aura/test/x11_event_sender.h",
1203            # Part of //ui/views:test_support which is testingonly.
1204            "//ui/views/test/ui_controls_factory_desktop_aurax11.cc",
1205            "//ui/views/test/ui_controls_factory_desktop_aurax11.h",
1206          ]
1207        } else {
1208          sources += [
1209            # Support for UI input events.
1210            # Part of //ui/base:test_support which is testingonly.
1211            "//ui/aura/test/ui_controls_factory_ozone.cc",
1212            # Part of //ui//events:test_support which is testingonly.
1213            "//ui/events/test/events_test_utils.cc"
1214          ]
1215        }
1216      }
1217    }
1218
1219    if (is_mac) {
1220      sources += [
1221        "libcef/browser/views/view_util_mac.mm",
1222
1223        # Part of //ui/views:test_support which is testingonly.
1224        "//ui/views/test/desktop_test_views_delegate_mac.mm",
1225        "//ui/views/test/test_views_delegate_mac.mm",
1226
1227        # Support for UI input events.
1228        # Part of //ui/base:test_support which is testingonly.
1229        "//ui/base/test/ui_controls_mac.mm",
1230        # Part of //ui//events:test_support which is testingonly.
1231        "//ui/events/test/cocoa_test_event_utils.mm",
1232      ]
1233    }
1234  } else {
1235    sources += [
1236      # Provides stub implementations for the views static methods.
1237      "libcef_dll/views_stub.cc",
1238    ]
1239  }
1240}
1241
1242
1243#
1244# libcef_dll_wrapper static targets.
1245#
1246
1247# Configuration that will be applied to all targets that depend on
1248# libcef_dll_wrapper.
1249config("libcef_dll_wrapper_config") {
1250  include_dirs = [
1251    # CEF sources use include paths relative to the CEF root directory.
1252    ".",
1253    # CEF generates some header files that also need to be discoverable.
1254    # They will be copied to the include/ directory in the binary distribution.
1255    "$root_out_dir/includes",
1256  ]
1257}
1258
1259# libcef_dll_wrapper target.
1260static_library("libcef_dll_wrapper") {
1261  sources = includes_common +
1262            gypi_paths.autogen_cpp_includes +
1263            gypi_paths2.includes_capi +
1264            gypi_paths.autogen_capi_includes +
1265            gypi_paths2.includes_wrapper +
1266            gypi_paths2.libcef_dll_wrapper_sources_base +
1267            gypi_paths2.libcef_dll_wrapper_sources_common +
1268            gypi_paths.autogen_client_side
1269
1270  if (is_mac) {
1271    sources += gypi_paths2.libcef_dll_wrapper_sources_mac
1272  }
1273
1274  defines = [ "WRAPPING_CEF_SHARED" ]
1275
1276  configs += [ ":libcef_dll_wrapper_config" ]
1277  public_configs = [ ":libcef_dll_wrapper_config" ]
1278}
1279
1280
1281#
1282# cef_sandbox target.
1283#
1284
1285if (is_win) {
1286  static_library("cef_sandbox") {
1287    sources = [ "libcef_dll/sandbox/sandbox_win.cc" ]
1288    # CEF sources use include paths relative to the CEF root directory.
1289    include_dirs = [ "." ]
1290    deps = [ "libcef/features", "//sandbox" ]
1291  }
1292}
1293
1294if (is_mac) {
1295  static_library("cef_sandbox") {
1296    sources = [ "libcef_dll/sandbox/sandbox_mac.mm" ]
1297    # CEF sources use include paths relative to the CEF root directory.
1298    include_dirs = [ "." ]
1299    deps = [
1300      "//build/config:executable_deps",
1301      "//sandbox/mac:seatbelt"
1302    ]
1303  }
1304}
1305
1306#
1307# Resource grit/pack targets.
1308#
1309
1310# Included in locales/*.pak via //chrome/chrome_repack_locales.gni.
1311grit("cef_strings") {
1312  source = "libcef/resources/cef_strings.grd"
1313  outputs = [
1314    "grit/cef_strings.h",
1315  ]
1316  all_locales = locales + [ "fake-bidi" ]
1317  foreach(locale, all_locales) {
1318    outputs += [ "cef_strings_${locale}.pak" ]
1319  }
1320}
1321
1322# Included in resources.pak via //chrome/chrome_paks.gni.
1323grit("cef_resources") {
1324  source = "libcef/resources/cef_resources.grd"
1325  outputs = [
1326    "grit/cef_resources.h",
1327    "cef_resources.pak",
1328  ]
1329  grit_flags = [
1330    "-E",
1331    "root_gen_dir=" + rebase_path(root_gen_dir, root_build_dir),
1332  ]
1333}
1334
1335# Helper for generating pack header files.
1336template("make_pack_header") {
1337  assert(defined(invoker.header))
1338  assert(defined(invoker.inputs))
1339  assert(defined(invoker.deps))
1340
1341  action("make_pack_header_${target_name}") {
1342    script = "tools/make_pack_header.py"
1343
1344    inputs = invoker.inputs
1345    outputs = [ invoker.header ]
1346
1347    args = rebase_path(outputs, root_build_dir) +
1348           rebase_path(inputs, root_build_dir)
1349
1350    deps = invoker.deps
1351  }
1352}
1353
1354# Generate cef_pack_resources.h.
1355make_pack_header("resources") {
1356  header = "$root_out_dir/includes/include/cef_pack_resources.h"
1357  inputs = [
1358    "$root_gen_dir/base/tracing/protos/grit/tracing_proto_resources.h",
1359    "$root_gen_dir/cef/grit/cef_resources.h",
1360    "$root_gen_dir/chrome/grit/browser_resources.h",
1361    "$root_gen_dir/chrome/grit/common_resources.h",
1362    "$root_gen_dir/chrome/grit/component_extension_resources.h",
1363    "$root_gen_dir/chrome/grit/dev_ui_browser_resources.h",
1364    "$root_gen_dir/chrome/grit/renderer_resources.h",
1365    "$root_gen_dir/components/grit/components_resources.h",
1366    "$root_gen_dir/components/grit/dev_ui_components_resources.h",
1367    "$root_gen_dir/content/browser/devtools/grit/devtools_resources.h",
1368    "$root_gen_dir/content/browser/tracing/grit/tracing_resources.h",
1369    "$root_gen_dir/content/browser/webrtc/resources/grit/webrtc_internals_resources.h",
1370    "$root_gen_dir/content/grit/content_resources.h",
1371    "$root_gen_dir/content/grit/dev_ui_content_resources.h",
1372    "$root_gen_dir/extensions/grit/extensions_browser_resources.h",
1373    "$root_gen_dir/extensions/grit/extensions_renderer_resources.h",
1374    "$root_gen_dir/extensions/grit/extensions_resources.h",
1375    "$root_gen_dir/mojo/public/js/grit/mojo_bindings_resources.h",
1376    "$root_gen_dir/net/grit/net_resources.h",
1377    "$root_gen_dir/third_party/blink/public/resources/grit/blink_resources.h",
1378    "$root_gen_dir/ui/resources/grit/ui_resources.h",
1379    "$root_gen_dir/ui/resources/grit/webui_generated_resources.h",
1380    "$root_gen_dir/ui/resources/grit/webui_resources.h",
1381  ]
1382
1383  deps = [
1384    ":cef_resources",
1385    "//base/tracing/protos:chrome_track_event_resources",
1386    "//chrome/browser:dev_ui_browser_resources",
1387    "//chrome/browser:resources",
1388    "//chrome/browser/resources:component_extension_resources",
1389    "//chrome/common:resources",
1390    "//chrome/renderer:resources",
1391    "//components/resources:components_resources",
1392    "//components/resources:dev_ui_components_resources",
1393    "//content/browser/devtools:devtools_resources",
1394    "//content/browser/tracing:resources",
1395    "//content/browser/webrtc/resources",
1396    "//content:content_resources",
1397    "//content:dev_ui_content_resources",
1398    "//extensions:extensions_browser_resources",
1399    "//extensions:extensions_renderer_resources",
1400    "//extensions:extensions_resources_grd",
1401    "//mojo/public/js:resources",
1402    "//net:net_resources",
1403    "//third_party/blink/public:resources",
1404    "//ui/resources:ui_resources_grd",
1405    "//ui/resources:webui_generated_resources_grd",
1406    "//ui/resources:webui_resources_grd",
1407  ]
1408
1409  if (toolkit_views) {
1410    inputs += [ "$root_gen_dir/ui/views/resources/grit/views_resources.h" ]
1411    deps += [ "//ui/views/resources:resources_grd" ]
1412  }
1413}
1414
1415# Generate cef_pack_strings.h.
1416make_pack_header("strings") {
1417  header = "$root_out_dir/includes/include/cef_pack_strings.h"
1418  inputs = [
1419    "$root_gen_dir/cef/grit/cef_strings.h",
1420    "$root_gen_dir/chrome/grit/chromium_strings.h",
1421    "$root_gen_dir/chrome/grit/generated_resources.h",
1422    "$root_gen_dir/chrome/grit/locale_settings.h",
1423    "$root_gen_dir/chrome/grit/platform_locale_settings.h",
1424    "$root_gen_dir/components/omnibox/resources/grit/omnibox_resources.h",
1425    "$root_gen_dir/components/strings/grit/components_chromium_strings.h",
1426    "$root_gen_dir/components/strings/grit/components_strings.h",
1427    "$root_gen_dir/extensions/strings/grit/extensions_strings.h",
1428    "$root_gen_dir/services/strings/grit/services_strings.h",
1429    "$root_gen_dir/third_party/blink/public/strings/grit/blink_strings.h",
1430    "$root_gen_dir/ui/strings/grit/ui_strings.h",
1431  ]
1432
1433  deps = [
1434    ":cef_strings",
1435    "//chrome/app:chromium_strings",
1436    "//chrome/app:generated_resources",
1437    "//chrome/app/resources:locale_settings",
1438    "//chrome/app/resources:platform_locale_settings",
1439    "//components/omnibox/resources:omnibox_resources",
1440    "//components/strings:components_chromium_strings",
1441    "//components/strings:components_locale_settings",
1442    "//components/strings:components_strings",
1443    "//extensions/strings",
1444    "//services/strings",
1445    "//third_party/blink/public/strings",
1446    "//ui/strings:app_locale_settings",
1447    "//ui/strings:ui_strings",
1448  ]
1449}
1450
1451# Generate cef_api_hash.h.
1452action("make_api_hash_header") {
1453  script = "tools/make_api_hash_header.py"
1454
1455  # List of all C API files that will be checked for changes by cef_api_hash.py.
1456  inputs = gypi_paths2.includes_common_capi +
1457           gypi_paths2.includes_linux_capi +
1458           gypi_paths2.includes_mac_capi +
1459           gypi_paths2.includes_win_capi +
1460           gypi_paths2.includes_capi +
1461           gypi_paths.autogen_capi_includes
1462  include_dir = [ "include" ]
1463  outputs = [ "$root_out_dir/includes/include/cef_api_hash.h" ]
1464
1465  args = rebase_path(outputs + include_dir, root_build_dir)
1466}
1467
1468# Generate pack files and associated CEF header files.
1469group("cef_make_headers") {
1470  deps = [
1471    ":make_pack_header_resources",
1472    ":make_pack_header_strings",
1473    ":make_api_hash_header",
1474  ]
1475}
1476
1477
1478#
1479# libcef dll/framework target.
1480#
1481
1482if (is_mac) {
1483  cef_framework_name = "Chromium Embedded Framework"
1484
1485  tweak_info_plist("cef_framework_plist") {
1486    info_plist = "libcef/resources/framework-Info.plist"
1487    args = [
1488      "--breakpad=0",
1489      "--keystone=0",
1490      "--scm=1",
1491      "--version",
1492      cef_plist_version,
1493      "--branding",
1494      cef_framework_name,
1495    ]
1496  }
1497
1498  bundle_data("cef_framework_resources") {
1499    sources = []
1500    public_deps = []
1501
1502    if (icu_use_data_file) {
1503      sources += [ "$root_out_dir/icudtl.dat" ]
1504      public_deps += [ "//third_party/icu:icudata", ]
1505    }
1506
1507    if (v8_use_external_startup_data) {
1508      sources += [
1509        "$root_out_dir/snapshot_blob.bin",
1510      ]
1511      public_deps += [ "//v8" ]
1512      if (use_v8_context_snapshot) {
1513        sources += [ "$root_out_dir/$v8_context_snapshot_filename" ]
1514        public_deps += [ "//tools/v8_context_snapshot" ]
1515      }
1516    }
1517
1518    outputs = [
1519      "{{bundle_resources_dir}}/{{source_file_part}}",
1520    ]
1521  }
1522
1523  if (use_egl) {
1524    # Add the ANGLE .dylibs in the MODULE_DIR of the Framework app bundle.
1525    bundle_data("cef_framework_angle_binaries") {
1526      sources = [
1527        "$root_out_dir/egl_intermediates/libEGL.dylib",
1528        "$root_out_dir/egl_intermediates/libGLESv2.dylib",
1529      ]
1530      outputs = [
1531        "{{bundle_contents_dir}}/Libraries/{{source_file_part}}",
1532      ]
1533      public_deps = [
1534        "//ui/gl:angle_library_copy",
1535      ]
1536    }
1537
1538    # Add the SwiftShader .dylibs in the MODULE_DIR of the Framework app bundle.
1539    bundle_data("cef_framework_swiftshader_binaries") {
1540      sources = [
1541        "$root_out_dir/egl_intermediates/libswiftshader_libEGL.dylib",
1542        "$root_out_dir/egl_intermediates/libswiftshader_libGLESv2.dylib",
1543        "$root_out_dir/vk_intermediates/libvk_swiftshader.dylib",
1544        "$root_out_dir/vk_intermediates/vk_swiftshader_icd.json",
1545      ]
1546      outputs = [
1547        "{{bundle_contents_dir}}/Libraries/{{source_file_part}}",
1548      ]
1549      public_deps = [
1550        "//ui/gl:swiftshader_egl_library_copy",
1551        "//ui/gl:swiftshader_vk_library_copy",
1552      ]
1553    }
1554  }
1555
1556  group("cef_framework_angle_library") {
1557    if (use_egl) {
1558      deps = [
1559        ":cef_framework_angle_binaries",
1560      ]
1561    }
1562  }
1563
1564  group("cef_framework_swiftshader_library") {
1565    if (use_egl) {
1566      deps = [
1567        ":cef_framework_swiftshader_binaries",
1568      ]
1569    }
1570  }
1571
1572  mac_framework_bundle("cef_framework") {
1573    output_name = cef_framework_name
1574
1575    framework_version = "A"
1576    framework_contents = [
1577      "Libraries",
1578      "Resources",
1579    ]
1580
1581    sources = includes_common +
1582              includes_mac +
1583              gypi_paths.autogen_cpp_includes +
1584              gypi_paths2.includes_capi +
1585              gypi_paths.autogen_capi_includes +
1586              gypi_paths2.libcef_sources_common +
1587              gypi_paths.autogen_library_side
1588
1589    deps = [
1590      ":cef_framework_angle_library",
1591      ":cef_framework_resources",
1592      ":cef_framework_swiftshader_library",
1593      ":libcef_static",
1594    ]
1595
1596    # We don't link the framework so just use the path from the main executable.
1597    ldflags = [
1598      "-Wl,-install_name,@executable_path/../Frameworks/$output_name.framework/$output_name",
1599      "-compatibility_version",
1600      cef_dylib_version,
1601      "-current_version",
1602      cef_dylib_version,
1603    ]
1604
1605    if (is_component_build) {
1606      # Set up the rpath for the framework so that it can find dylibs in the
1607      # root output directory. The framework is at
1608      # $app_name.app/Contents/Frameworks/$output_name.framework/Versions/A/$output_name
1609      # so use loader_path to go back to the root output directory.
1610      ldflags += [
1611        "-rpath",
1612        "@loader_path/../../../../../..",
1613      ]
1614    }
1615
1616    info_plist_target = ":cef_framework_plist"
1617  }
1618} else {
1619  shared_library("libcef") {
1620    sources = includes_common +
1621              gypi_paths.autogen_cpp_includes +
1622              gypi_paths2.includes_capi +
1623              gypi_paths.autogen_capi_includes +
1624              gypi_paths2.libcef_sources_common +
1625              gypi_paths.autogen_library_side
1626
1627    deps = [
1628      ":libcef_static",
1629    ]
1630
1631    if (is_win) {
1632      sources += includes_win + [
1633        "libcef_dll/libcef_dll.rc",
1634      ]
1635
1636      deps += [
1637        # Bring in ui_unscaled_resources.rc which contains custom cursors.
1638        # TODO(cef): Remove this once custom cursors can be loaded via
1639        # ResourceBundle. See crbug.com/147663.
1640        "//ui/resources:ui_unscaled_resources_grd",
1641      ]
1642    }
1643
1644    if (is_linux && !is_debug && use_allocator=="none") {
1645      # Only export necessary symbols from libcef.so.
1646      # Don't do this in Debug builds because it causes the resulting
1647      # application to crash.
1648      # Also need to do this for ASAN builds to work around
1649      # https://crbug.com/832808.
1650      ldflags = [ "-Wl,--version-script=" +
1651                  rebase_path("//cef/libcef_dll/libcef.lst") ]
1652    }
1653  }
1654}
1655
1656
1657#
1658# Executable/app targets.
1659#
1660
1661if (is_mac) {
1662  # Helper for generating the CEF app bundle.
1663  template("cef_app") {
1664    assert(defined(invoker.helper_info_plist))
1665    assert(defined(invoker.helper_sources))
1666    assert(defined(invoker.info_plist))
1667    assert(defined(invoker.sources))
1668
1669    app_name = target_name
1670    app_helper_name = "$app_name Helper"
1671    app_testonly = defined(invoker.testonly) && invoker.testonly
1672
1673    tweak_info_plist("${app_name}_helper_plist") {
1674      testonly = app_testonly
1675      info_plist = invoker.helper_info_plist
1676      args = [
1677        "--breakpad=0",
1678        "--keystone=0",
1679        "--scm=0",
1680        "--version",
1681        cef_plist_version,
1682      ]
1683    }
1684
1685    template("cef_helper_app") {
1686      mac_app_bundle(target_name) {
1687        assert(defined(invoker.helper_sources))
1688        assert(defined(invoker.helper_name_suffix))
1689        assert(defined(invoker.helper_bundle_id_suffix))
1690
1691        testonly = app_testonly
1692        output_name = app_helper_name + invoker.helper_name_suffix
1693
1694        sources = invoker.helper_sources
1695
1696        extra_substitutions = [
1697          "BUNDLE_ID_SUFFIX=${invoker.helper_bundle_id_suffix}",
1698        ]
1699
1700        deps = [
1701          ":cef_make_headers",
1702          ":cef_sandbox",
1703          ":libcef_dll_wrapper",
1704        ]
1705        if (defined(invoker.helper_deps)) {
1706          deps += invoker.helper_deps
1707        }
1708
1709        ldflags = [
1710          # The helper is in $app_name.app/Contents/Frameworks/$app_name Helper.app/Contents/MacOS/
1711          # so set rpath up to the base.
1712          "-rpath",
1713           "@executable_path/../../../../../..",
1714        ]
1715
1716        info_plist_target = ":${app_name}_helper_plist"
1717
1718        if (defined(invoker.helper_defines)) {
1719          defines = invoker.helper_defines
1720        }
1721      }
1722    }
1723
1724    foreach(helper_params, content_mac_helpers) {
1725      _helper_target = helper_params[0]
1726      _helper_bundle_id = helper_params[1]
1727      _helper_suffix = helper_params[2]
1728      cef_helper_app("${app_name}_helper_app_${_helper_target}") {
1729        helper_sources = invoker.helper_sources
1730        if (defined(invoker.helper_deps)) {
1731          helper_deps = invoker.helper_deps
1732        }
1733        if (defined(invoker.helper_defines)) {
1734          helper_defines = invoker.helper_defines
1735        }
1736
1737        helper_name_suffix = _helper_suffix
1738        helper_bundle_id_suffix = _helper_bundle_id
1739      }
1740    }
1741
1742    bundle_data("${app_name}_framework_bundle_data") {
1743      testonly = app_testonly
1744      sources = [
1745        "$root_out_dir/$cef_framework_name.framework",
1746      ]
1747
1748      public_deps = [
1749        ":cef_framework",
1750      ]
1751
1752      foreach(helper_params, content_mac_helpers) {
1753        sources += [
1754          "$root_out_dir/${app_helper_name}${helper_params[2]}.app",
1755        ]
1756        public_deps += [ ":${app_name}_helper_app_${helper_params[0]}" ]
1757      }
1758
1759      outputs = [
1760        "{{bundle_contents_dir}}/Frameworks/{{source_file_part}}",
1761      ]
1762    }
1763
1764    tweak_info_plist("${app_name}_plist") {
1765      testonly = app_testonly
1766      info_plist = invoker.info_plist
1767      args = [
1768        "--scm=1",
1769        "--version",
1770        cef_plist_version,
1771      ]
1772    }
1773
1774    mac_app_bundle(app_name) {
1775      testonly = app_testonly
1776      output_name = app_name
1777
1778      sources = invoker.sources
1779
1780      public_deps = [ ":libcef_dll_wrapper" ]
1781      deps = [
1782        ":cef_make_headers",
1783        ":libcef_dll_wrapper",
1784        ":${app_name}_framework_bundle_data",
1785      ]
1786      if (defined(invoker.deps)) {
1787        deps += invoker.deps
1788      }
1789
1790      if (defined(invoker.frameworks)) {
1791        frameworks = invoker.frameworks
1792      }
1793
1794      if (defined(invoker.defines)) {
1795        defines = invoker.defines
1796      }
1797
1798      info_plist_target = ":${app_name}_plist"
1799    }
1800  }
1801
1802
1803  #
1804  # cefclient app targets.
1805  #
1806
1807  bundle_data("cefclient_resources_bundle_data") {
1808    sources = gypi_paths2.shared_sources_resources +
1809              gypi_paths2.cefclient_sources_resources + [
1810      "tests/cefclient/resources/mac/cefclient.icns",
1811    ]
1812
1813    outputs = [
1814      "{{bundle_resources_dir}}/{{source_file_part}}",
1815    ]
1816  }
1817
1818  bundle_data("cefclient_resources_bundle_data_extensions_set_page_color") {
1819    sources = gypi_paths2.cefclient_sources_resources_extensions_set_page_color
1820    outputs = [
1821      "{{bundle_resources_dir}}/extensions/set_page_color/{{source_file_part}}",
1822    ]
1823  }
1824
1825  bundle_data("cefclient_resources_bundle_data_english") {
1826    sources = [
1827      "tests/cefclient/resources/mac/English.lproj/InfoPlist.strings",
1828    ]
1829
1830    outputs = [
1831      "{{bundle_resources_dir}}/English.lproj/{{source_file_part}}",
1832    ]
1833  }
1834
1835  mac_xib_bundle_data("cefclient_xibs") {
1836    sources = [
1837      "tests/cefclient/resources/mac/English.lproj/MainMenu.xib",
1838    ]
1839
1840    output_path = "{{bundle_resources_dir}}/English.lproj"
1841  }
1842
1843  cef_app("cefclient") {
1844    helper_info_plist = "tests/cefclient/resources/mac/helper-Info.plist"
1845    helper_sources = includes_common +
1846                     includes_mac +
1847                     gypi_paths2.includes_wrapper +
1848                     gypi_paths2.includes_wrapper_mac +
1849                     gypi_paths2.shared_sources_common +
1850                     gypi_paths2.shared_sources_renderer +
1851                     gypi_paths2.shared_sources_mac_helper +
1852                     gypi_paths2.cefclient_sources_common +
1853                     gypi_paths2.cefclient_sources_renderer
1854    helper_defines = [
1855      "CEF_USE_SANDBOX",
1856    ]
1857
1858    info_plist = "tests/cefclient/resources/mac/Info.plist"
1859    sources = includes_common +
1860              includes_mac +
1861              gypi_paths2.includes_wrapper +
1862              gypi_paths2.includes_wrapper_mac +
1863              gypi_paths2.shared_sources_browser +
1864              gypi_paths2.shared_sources_common +
1865              gypi_paths2.shared_sources_mac +
1866              gypi_paths2.cefclient_sources_browser +
1867              gypi_paths2.cefclient_sources_common +
1868              gypi_paths2.cefclient_sources_mac
1869    deps = [
1870      ":cefclient_resources_bundle_data",
1871      ":cefclient_resources_bundle_data_extensions_set_page_color",
1872      ":cefclient_resources_bundle_data_english",
1873      ":cefclient_xibs",
1874    ]
1875    frameworks = [
1876      "AppKit.framework",
1877      "OpenGL.framework",
1878    ]
1879    defines = [
1880      "CEF_USE_SANDBOX",
1881    ]
1882  }
1883
1884
1885  #
1886  # cefsimple app targets.
1887  #
1888
1889  bundle_data("cefsimple_resources_bundle_data") {
1890    sources = [
1891      "tests/cefsimple/mac/cefsimple.icns",
1892    ]
1893
1894    outputs = [
1895      "{{bundle_resources_dir}}/{{source_file_part}}",
1896    ]
1897  }
1898
1899  bundle_data("cefsimple_resources_bundle_data_english") {
1900    sources = [
1901      "tests/cefsimple/mac/English.lproj/InfoPlist.strings",
1902    ]
1903
1904    outputs = [
1905      "{{bundle_resources_dir}}/English.lproj/{{source_file_part}}",
1906    ]
1907  }
1908
1909  mac_xib_bundle_data("cefsimple_xibs") {
1910    sources = [
1911      "tests/cefsimple/mac/English.lproj/MainMenu.xib",
1912    ]
1913    output_path = "{{bundle_resources_dir}}/English.lproj"
1914  }
1915
1916  cef_app("cefsimple") {
1917    helper_info_plist = "tests/cefsimple/mac/helper-Info.plist"
1918    helper_sources = includes_common +
1919                     includes_mac +
1920                     gypi_paths2.includes_wrapper +
1921                     gypi_paths2.includes_wrapper_mac +
1922                     gypi_paths2.cefsimple_sources_mac_helper
1923    helper_defines = [
1924      "CEF_USE_SANDBOX",
1925    ]
1926
1927    info_plist = "tests/cefsimple/mac/Info.plist"
1928    sources = includes_common +
1929              includes_mac +
1930              gypi_paths2.includes_wrapper +
1931              gypi_paths2.includes_wrapper_mac +
1932              gypi_paths2.cefsimple_sources_common +
1933              gypi_paths2.cefsimple_sources_mac
1934    deps = [
1935      ":cefsimple_resources_bundle_data",
1936      ":cefsimple_resources_bundle_data_english",
1937      ":cefsimple_xibs",
1938    ]
1939    frameworks = [
1940      "AppKit.framework",
1941    ]
1942    defines = [
1943      "CEF_USE_SANDBOX",
1944    ]
1945  }
1946
1947
1948  #
1949  # ceftests app targets.
1950  #
1951
1952  bundle_data("ceftests_resources_bundle_data") {
1953    sources = gypi_paths2.shared_sources_resources + [
1954      "tests/ceftests/resources/mac/ceftests.icns",
1955    ]
1956
1957    outputs = [
1958      "{{bundle_resources_dir}}/{{source_file_part}}",
1959    ]
1960  }
1961
1962  bundle_data("ceftests_resources_bundle_data_english") {
1963    sources = [
1964      "tests/ceftests/resources/mac/English.lproj/InfoPlist.strings",
1965    ]
1966
1967    outputs = [
1968      "{{bundle_resources_dir}}/English.lproj/{{source_file_part}}",
1969    ]
1970  }
1971
1972  mac_xib_bundle_data("ceftests_xibs") {
1973    sources = [
1974      "tests/ceftests/resources/mac/English.lproj/MainMenu.xib",
1975    ]
1976    output_path = "{{bundle_resources_dir}}/English.lproj"
1977  }
1978
1979  cef_app("ceftests") {
1980    testonly = true
1981
1982    helper_info_plist = "tests/ceftests/resources/mac/helper-Info.plist"
1983    helper_sources = gypi_paths2.shared_sources_common +
1984                     gypi_paths2.shared_sources_renderer +
1985                     gypi_paths2.shared_sources_mac_helper +
1986                     gypi_paths2.ceftests_sources_mac_helper
1987    helper_deps = [
1988      "//testing/gtest",
1989    ]
1990    helper_defines = [
1991      "CEF_USE_SANDBOX",
1992    ]
1993
1994    info_plist = "tests/ceftests/resources/mac/Info.plist"
1995    sources = includes_common +
1996              includes_mac +
1997              gypi_paths2.includes_wrapper +
1998              gypi_paths2.includes_wrapper_mac +
1999              gypi_paths2.shared_sources_browser +
2000              gypi_paths2.shared_sources_common +
2001              gypi_paths2.shared_sources_mac +
2002              gypi_paths2.ceftests_sources_common +
2003              gypi_paths2.ceftests_sources_mac
2004    deps = [
2005      ":ceftests_resources_bundle_data",
2006      ":ceftests_resources_bundle_data_english",
2007      ":ceftests_xibs",
2008      "//testing/gtest",
2009    ]
2010    frameworks = [
2011      "AppKit.framework",
2012    ]
2013    defines = [
2014      "CEF_USE_SANDBOX",
2015    ]
2016  }
2017} else {
2018  #
2019  # cefclient targets.
2020  #
2021
2022  # The cefclient target depends on packages that are not available in the
2023  # default sysroot environment.
2024  if (is_linux && !use_sysroot) {
2025    pkg_config("glib") {
2026      packages = [
2027        "glib-2.0",
2028      ]
2029    }
2030  }
2031
2032  if (is_linux && cef_use_gtk) {
2033    pkg_config("gtk") {
2034      packages = [
2035        "gmodule-2.0",
2036        "gtk+-3.0",
2037        "gthread-2.0",
2038        "gtk+-unix-print-3.0",
2039        "xi",
2040      ]
2041    }
2042  }
2043
2044  if (is_linux) {
2045    copy("copy_cefclient_files") {
2046      sources = gypi_paths2.shared_sources_resources +
2047                gypi_paths2.cefclient_sources_resources
2048      outputs = [ "${root_out_dir}/cefclient_files/{{source_file_part}}" ]
2049    }
2050
2051    copy("copy_cefclient_files_extensions_set_page_color") {
2052      sources = gypi_paths2.cefclient_sources_resources_extensions_set_page_color
2053      outputs = [ "${root_out_dir}/cefclient_files/extensions/set_page_color/{{source_file_part}}" ]
2054    }
2055  }
2056
2057  executable("cefclient") {
2058    sources = includes_common +
2059              gypi_paths2.includes_wrapper +
2060              gypi_paths2.shared_sources_browser +
2061              gypi_paths2.shared_sources_common +
2062              gypi_paths2.shared_sources_renderer +
2063              gypi_paths2.cefclient_sources_browser +
2064              gypi_paths2.cefclient_sources_common +
2065              gypi_paths2.cefclient_sources_renderer
2066
2067    deps = [
2068      ":libcef",
2069      ":libcef_dll_wrapper",
2070    ]
2071
2072    defines = [
2073      "CEF_USE_SANDBOX",
2074    ]
2075
2076    if (is_win) {
2077      sources += includes_win +
2078                 gypi_paths2.shared_sources_win +
2079                 gypi_paths2.cefclient_sources_win
2080
2081      # Set /SUBSYSTEM:WINDOWS.
2082      configs -= [ "//build/config/win:console" ]
2083      configs += [ "//build/config/win:windowed" ]
2084
2085      defines += [
2086        "CEF_USE_ATL",
2087      ]
2088
2089      deps += [
2090        ":cef_sandbox",
2091        "//build/win:default_exe_manifest",
2092      ]
2093
2094      libs = [
2095        "comctl32.lib",
2096        "d3d11.lib",
2097        "imm32.lib",
2098        "oleacc.lib",
2099        "rpcrt4.lib",
2100        "shlwapi.lib",
2101      ]
2102
2103      if (target_cpu != "arm64") {
2104        libs += [
2105          "opengl32.lib",
2106          "glu32.lib"
2107        ]
2108      }
2109    }
2110
2111    if (is_linux) {
2112      sources += includes_linux +
2113                 gypi_paths2.shared_sources_linux +
2114                 gypi_paths2.cefclient_sources_linux
2115
2116      deps += [
2117        ":copy_cefclient_files",
2118        ":copy_cefclient_files_extensions_set_page_color",
2119      ]
2120
2121      libs = [
2122        "GL",
2123        "X11",
2124      ]
2125
2126      if (cef_use_gtk) {
2127        configs += [
2128          ":gtk",
2129        ]
2130      }
2131
2132      if (is_component_build) {
2133        if (use_allocator=="tcmalloc") {
2134          # Link to base to initialize tcmalloc allocator shims, otherwise
2135          # base::allocator::IsAllocatorInitialized check fails
2136          deps += [ "//base" ]
2137        }
2138      } else {
2139        # Set rpath to find our own libfreetype even in a non-component build.
2140        configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
2141      }
2142    }
2143  }
2144
2145
2146  #
2147  # cefsimple targets.
2148  #
2149
2150  executable("cefsimple") {
2151    sources = includes_common +
2152              gypi_paths2.includes_wrapper +
2153              gypi_paths2.cefsimple_sources_common
2154
2155    deps = [
2156      ":libcef",
2157      ":libcef_dll_wrapper",
2158    ]
2159
2160    defines = [
2161      "CEF_USE_SANDBOX",
2162    ]
2163
2164    if (is_win) {
2165      sources += includes_win +
2166                 gypi_paths2.cefsimple_sources_win
2167
2168      # Set /SUBSYSTEM:WINDOWS.
2169      configs -= [ "//build/config/win:console" ]
2170      configs += [ "//build/config/win:windowed" ]
2171
2172      deps += [
2173        ":cef_sandbox",
2174        "//build/win:default_exe_manifest",
2175      ]
2176
2177      libs = [
2178        "comctl32.lib",
2179        "shlwapi.lib",
2180        "rpcrt4.lib",
2181      ]
2182    }
2183
2184    if (is_linux) {
2185      sources += includes_linux +
2186                 gypi_paths2.cefsimple_sources_linux
2187
2188      if (use_x11) {
2189        libs = [
2190          "X11",
2191        ]
2192      }
2193
2194      if (!is_component_build) {
2195        # Set rpath to find our own libfreetype even in a non-component build.
2196        configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
2197      }
2198    }
2199  }
2200
2201
2202  #
2203  # ceftests targets.
2204  #
2205
2206  if (is_linux) {
2207    copy("copy_ceftests_files") {
2208      sources = gypi_paths2.shared_sources_resources
2209      outputs = [ "${root_out_dir}/ceftests_files/{{source_file_part}}" ]
2210    }
2211  }
2212
2213  executable("ceftests") {
2214    testonly = true
2215
2216    sources = includes_common +
2217              gypi_paths2.includes_wrapper +
2218              gypi_paths2.shared_sources_browser +
2219              gypi_paths2.shared_sources_common +
2220              gypi_paths2.shared_sources_renderer +
2221              gypi_paths2.ceftests_sources_common
2222
2223    deps = [
2224      ":libcef",
2225      ":libcef_dll_wrapper",
2226      "//testing/gtest",
2227    ]
2228
2229    defines = [
2230      "CEF_USE_SANDBOX",
2231    ]
2232
2233    if (is_win) {
2234      sources += gypi_paths2.shared_sources_win +
2235                 gypi_paths2.ceftests_sources_win
2236
2237      deps += [
2238        ":cef_sandbox",
2239        "//build/win:default_exe_manifest",
2240      ]
2241    }
2242
2243    if (is_linux) {
2244      sources += gypi_paths2.shared_sources_linux +
2245                 gypi_paths2.ceftests_sources_linux
2246
2247      if (use_x11) {
2248        libs = [
2249          "X11",
2250        ]
2251      } else {
2252        if (!use_sysroot) {
2253          configs += [ ":glib" ]
2254        }
2255      }
2256
2257      deps += [
2258        ":copy_ceftests_files",
2259      ]
2260    }
2261
2262    if (is_linux && !is_component_build) {
2263      # Set rpath to find our own libfreetype even in a non-component build.
2264      configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
2265    }
2266  }
2267}
2268