Chromium Code Reviews| Index: headless/BUILD.gn |
| diff --git a/headless/BUILD.gn b/headless/BUILD.gn |
| index 55afe1f2833a2df59119165ab9391dc0350a1be4..8acf6f406d97fefc22caa691cfdac0e1d7dc59db 100644 |
| --- a/headless/BUILD.gn |
| +++ b/headless/BUILD.gn |
| @@ -19,9 +19,9 @@ config("headless_implementation") { |
| } |
| } |
| -group("headless") { |
| +group("headless_lib") { |
| deps = [ |
| - "//headless:headless_lib", |
| + "//headless:headless", |
| ] |
| } |
| @@ -202,7 +202,7 @@ action("gen_devtools_client_api") { |
| ] |
| } |
| -static_library("headless_lib") { |
| +component("headless") { |
| sources = generated_devtools_api + [ |
| "app/headless_shell_switches.cc", |
| "app/headless_shell_switches.h", |
| @@ -244,10 +244,6 @@ static_library("headless_lib") { |
| "lib/headless_crash_reporter_client.h", |
| "lib/headless_content_client.cc", |
| "lib/headless_content_client.h", |
| - "lib/headless_content_main_delegate.cc", |
| - "lib/headless_content_main_delegate.h", |
| - "lib/renderer/headless_content_renderer_client.cc", |
| - "lib/renderer/headless_content_renderer_client.h", |
| "public/headless_browser.cc", |
| "public/headless_browser.h", |
| "public/headless_browser_context.h", |
| @@ -328,9 +324,6 @@ static_library("headless_lib") { |
| "//components/crash/content/browser", |
| "//components/security_state/content", |
| "//components/security_state/core", |
| - "//content/public/app:both", |
| - "//content/public/browser", |
| - "//content/public/child:child", |
| "//content/public/common", |
| "//content/public/common:service_names", |
| "//services/service_manager/public/cpp", |
| @@ -342,15 +335,24 @@ static_library("headless_lib") { |
| "//url", |
| ] |
| - if (!is_mac) { |
| - deps += [ "//ui/aura" ] |
| + if (is_component_build) { |
| + sources += [ |
| + "lib/headless_content_main_delegate.cc", |
| + "lib/headless_content_main_delegate.h", |
| + "lib/renderer/headless_content_renderer_client.cc", |
| + "lib/renderer/headless_content_renderer_client.h", |
| + ] |
| + |
| + if (enable_basic_printing) { |
| + deps += [ |
| + "//components/printing/browser", |
| + "//components/printing/renderer", |
| + ] |
| + } |
| } |
| - if (enable_basic_printing) { |
| - deps += [ |
| - "//components/printing/browser", |
| - "//components/printing/renderer", |
| - ] |
| + if (!is_mac) { |
| + deps += [ "//ui/aura" ] |
| } |
| if (headless_use_embedded_resources) { |
| @@ -366,10 +368,31 @@ static_library("headless_lib") { |
| if (use_ozone) { |
| deps += [ "//ui/ozone" ] |
| } |
| - |
| configs += [ ":headless_implementation" ] |
| } |
| +source_set("headless_renderer") { |
| + deps = [ |
| + ":headless", |
| + ] |
| + if (!is_component_build) { |
| + sources = [ |
| + "lib/headless_content_main_delegate.cc", |
| + "lib/headless_content_main_delegate.h", |
| + "lib/renderer/headless_content_renderer_client.cc", |
| + "lib/renderer/headless_content_renderer_client.h", |
| + ] |
| + deps += [ "//ui/base" ] |
| + if (enable_basic_printing) { |
| + deps += [ |
| + "//components/printing/browser", |
| + "//components/printing/renderer", |
| + ] |
| + } |
| + configs += [ ":headless_implementation" ] |
| + } |
| +} |
| + |
| group("headless_tests") { |
| testonly = true |
| @@ -392,7 +415,7 @@ test("headless_unittests") { |
| ] |
| deps = [ |
| - ":headless_lib", |
| + ":headless", |
| "//base/test:run_all_unittests", |
| "//base/test:test_support", |
| "//testing/gmock", |
| @@ -466,15 +489,19 @@ test("headless_browsertests") { |
| deps = [ |
| ":embedder_mojo_for_testing", |
| ":headless_browser_tests_pak", |
| + ":headless_renderer", |
| "//base", |
| "//content/test:test_support", |
| - "//headless:headless_lib", |
| "//testing/gmock", |
| "//testing/gtest", |
| ] |
| } |
| -static_library("headless_shell_lib") { |
| +static_library("headless_shell_browser_lib") { |
| + if (is_multi_dll_chrome) { |
| + defines = [ "CHROME_MULTIPLE_DLL_BROWSER" ] |
| + } |
| + |
| sources = [ |
| "app/headless_shell.cc", |
| "app/headless_shell.h", |
|
alex clarke (OOO till 29th)
2017/04/19 07:47:09
Please add a comment explaining why these three ta
dvallet
2017/04/20 01:05:09
Thanks Alex! I added some documentation
|
| @@ -482,34 +509,88 @@ static_library("headless_shell_lib") { |
| "app/headless_shell_switches.h", |
| "app/shell_navigation_request.cc", |
| "app/shell_navigation_request.h", |
| + "lib/headless_content_main_delegate.cc", |
| + "lib/headless_content_main_delegate.h", |
| "public/headless_shell.h", |
| ] |
| deps = [ |
| - "//headless:headless_lib", |
| + ":headless", |
| + "//content/public/browser", |
| + "//content/public/common", |
| ] |
| + if (is_win) { |
| + deps += [ |
| + "//content:sandbox_helper_win", |
| + "//sandbox", |
| + ] |
| + } |
| + |
| configs += [ ":headless_implementation" ] |
| } |
| -executable("headless_shell") { |
| +static_library("headless_shell_child_lib") { |
| + if (is_multi_dll_chrome) { |
| + defines = [ "CHROME_MULTIPLE_DLL_CHILD" ] |
| + } |
| + |
| sources = [ |
| - "app/headless_shell_main.cc", |
| + "app/headless_shell.cc", |
| + "app/headless_shell.h", |
| + "app/headless_shell_switches.cc", |
| + "app/headless_shell_switches.h", |
| + "app/shell_navigation_request.cc", |
| + "app/shell_navigation_request.h", |
| + "lib/headless_content_main_delegate.cc", |
| + "lib/headless_content_main_delegate.h", |
| + "public/headless_shell.h", |
| ] |
| deps = [ |
| - "//headless:headless_shell_lib", |
| + ":headless_renderer", |
| + "//content/public/child:child", |
| + "//ui/base", |
| + ] |
| + |
| + configs += [ ":headless_implementation" ] |
| +} |
| + |
| +static_library("headless_shell_lib") { |
| + sources = [ |
| + "app/headless_shell.cc", |
| + "app/headless_shell.h", |
| + "app/headless_shell_switches.cc", |
| + "app/headless_shell_switches.h", |
| + "app/shell_navigation_request.cc", |
| + "app/shell_navigation_request.h", |
| + "public/headless_shell.h", |
| + ] |
| + |
| + deps = [ |
| + ":headless_renderer", |
| + "//content/public/app:both", |
| + "//content/public/browser", |
| + "//content/public/child:child", |
| + "//content/public/common", |
| ] |
| if (is_win) { |
| deps += [ |
| - "//build/win:default_exe_manifest", |
| "//content:sandbox_helper_win", |
| "//sandbox", |
| ] |
| } |
| +} |
| - configs += [ ":headless_implementation" ] |
| +executable("headless_shell") { |
| + sources = [ |
| + "app/headless_shell_main.cc", |
| + ] |
| + |
| + deps = [ |
| + ":headless_shell_lib", |
| + ] |
| } |
| process_version("version_header") { |
| @@ -527,6 +608,6 @@ executable("headless_example") { |
| ] |
| deps = [ |
| - "//headless:headless_shell_lib", |
| + ":headless_shell_lib", |
| ] |
| } |