Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / content / BUILD.gn
index 94c944d..7f24668 100644 (file)
@@ -9,26 +9,53 @@ config("content_implementation") {
   defines = [ "CONTENT_IMPLEMENTATION" ]
 }
 
+# When targets depend on, e.g. //content/public/browser, what happens? To
+# facilitate the complexity here, the "public" targets are groups that forward
+# to the right thing depending on the build mode. Say for additional
+# illustration, the public browser sources also depend on the public common
+# ones.
+#
+# The non-component build is easy:
+# foo ->
+#   //content/public/browser (group) ->
+#     //content/public/browser:browser_sources (source set) ->
+#       //content/browser (source set, this is the non-public browser target)
+#       //content/public/common:common_sources (source set)
+#
+# The component build is more complicated because we want everybody to depend on
+# one content shared library regardless of which public target they depend on:
+# foo ->
+#   //content/public/browser (group) ->
+#     //content (shared library) ->
+#       //content/public/browser:browser_sources (source set) ->
+#         //content/browser (source set; this is the non-public browser target)
+#         //content/public/common:common_sources (source set)
+#
+# That the internal content dependencies must depend on the *_sources targets
+# to avoid dependency cycles, and external dependencies must depend on the
+# //content/public/browser and similar targets to avoid double-linking (these
+# targets make sure the dependency goes through the content shared library
+# when doing a component build).
+
 content_shared_components = [
   "//content/gpu",
-  "//content/plugin",
-  "//content/ppapi_plugin",
-  "//content/public/app",
-  "//content/public/browser:sources",
-  "//content/public/child",
-  "//content/public/common",
-  "//content/public/plugin",
-  "//content/public/renderer",
-  "//content/renderer",
-  "//content/utility",
+  "//content/public/browser:browser_sources",
+  "//content/public/child:child_sources",
+  "//content/public/common:common_sources",
+  "//content/public/plugin:plugin_sources",
+  "//content/public/renderer:renderer_sources",
+  "//content/public/utility:utility_sources",
 ]
 
+if (enable_plugins) {
+  content_shared_components += [ "//content/ppapi_plugin" ]
+}
+
 if (is_component_build) {
   shared_library("content") {
-    deps = content_shared_components + [
-      "//content/app",
+    public_deps = content_shared_components + [
+      "//content/public/app:both_sources",
     ]
-    forward_dependent_configs_from = deps
   }
 } else {
   group("content") {
@@ -38,6 +65,7 @@ if (is_component_build) {
 
 grit("resources") {
   source = "content_resources.grd"
+  use_qualified_include = true
   outputs = [
     "grit/content_resources.h",
     "content_resources.pak",
@@ -48,84 +76,8 @@ grit("resources") {
 # This target exists to "hold" the content_export header so we can do proper
 # inclusion testing of it.
 source_set("export") {
-  visibility = "//content/*"
+  visibility = [ "//content/*" ]
   sources = [
     "content/common/content_export.h"
   ]
 }
-
-# Stubs ------------------------------------------------------------------------
-
-# TODO(brettw) remove this and add a proper dependency on libjingle once that
-# target has been converted to GN. This config sets up the include directories
-# so content can compile in the meantime.
-config("libjingle_stub_config") {
-  include_dirs = [
-    "//third_party/libjingle/overrides",
-    "//third_party/libjingle/source",
-    "//third_party/libyuv/include",
-    "//third_party/usrsctp",
-
-
-    "//third_party/webrtc/overrides",  # Must be before webrtc abd third_party.
-    "//third_party/webrtc",
-    "//third_party",
-  ]
-
-  defines = [
-    "FEATURE_ENABLE_SSL",
-    "FEATURE_ENABLE_VOICEMAIL",
-    "EXPAT_RELATIVE_PATH",
-    "GTEST_RELATIVE_PATH",
-    "NO_MAIN_THREAD_WRAPPING",
-    "NO_SOUND_SYSTEM",
-  ]
-
-  if (is_mac) {
-    defines += [ "OSX", "WEBRTC_MAC" ]
-  } else if (is_linux) {
-    defines += [ "LINUX", "WEBRTC_LINUX" ]
-  } else if (is_android) {
-    defines += [ "ANDROID", "WEBRTC_LINUX", "WEBRTC_ANDROID" ]
-  } else if (is_win) {
-    libs = [ "secur32.lib", "crypt32.lib", "iphlpapi.lib" ]
-    defines += [ "WEBRTC_WIN" ]
-  }
-
-  if (is_posix) {
-    defines += [ "POSIX", "WEBRTC_POSIX" ]
-  }
-  if (is_chromeos) {
-    defines += [ "CHROMEOS" ]
-  }
-}
-
-# Sets up include dirs while webrtc is being converted to GN.
-# TODO(GYP) remove when webrtc is ready.
-config("webrtc_stub_config") {
-  defines = [ "WEBRTC_CHROMIUM_BUILD" ]
-  include_dirs = [
-    "//third_party/webrtc/overrides",  # Must be first.
-    "//third_party",
-  ]
-
-  if (is_mac) {
-    defines += [ "WEBRTC_MAC" ]
-  } else if (is_win) {
-    defines += [ "WEBRTC_WIN" ]
-  } else if (is_linux) {
-    defines += [ "WEBRTC_LINUX" ]
-  } else if (is_ios) {
-    defines += [ "WEBRTC_MAC", "WEBRTC_IOS" ]
-  } else if (is_android) {
-    defines += [ "WEBRTC_LINUX", "WEBRTC_ANDROID" ]
-    import("//build/config/crypto.gni")
-    if (use_openssl) {
-      defines += [ "WEBRTC_ANDROID_OPENSLEQS" ]
-    }
-  }
-
-  if (is_posix) {
-    defines += [ "WEBRTC_POSIX" ]
-  }
-}