1# Copyright 2014 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5import("//tools/grit/grit_rule.gni")
6
7# TODO(GYP) uncomment when this is used below.
8#gypi_values = exec_script(
9#    "//build/gypi_to_gn.py",
10#    [ rebase_path("../chrome_common.gypi") ],
11#    "scope",
12#    [ "../chrome_common.gypi" ])
13
14# GYP version: chrome/chrome_resources.gyp:chrome_resources
15#              (generate_common_resources action)
16grit("resources") {
17  source = "common_resources.grd"
18}
19
20# GYP version: chrome/chrome_resources.gyp:chrome_resources
21#              (generate_extensions_api_resources action)
22grit("extensions_api_resources") {
23  source = "extensions_api_resources.grd"
24}
25
26# GYP version: chrome/chrome_common.gyp:common
27static_library("common") {
28  # TODO(GYP) Uncomment when these compile.
29  #sources = rebase_path(gypi_values.chrome_common_sources, ".", "//chrome")
30
31  configs += [ "//build/config/compiler:wexit_time_destructors" ]
32
33  deps = [
34    ":version",
35    #":installer_util",  TODO(GYP)
36    "//base:base",
37    "//base:i18n",
38    "//base:prefs",
39    "//base:base_static",
40    "//chrome:resources",
41    "//chrome:strings",
42    "//chrome/app/theme:theme_resources",
43    "//chrome/common:constants",
44    "//chrome/common/metrics/proto",
45    "//chrome/common/net",
46    "//chrome/common/safe_browsing:proto",
47    #"//components/cloud_devices:common",  TODO(GYP)
48    #"//components/json_schema",  TODO(GYP)
49    "//components/metrics",  
50    #"//components/components.gyp:policy_component_common",  TODO(GYP)
51    "//components/translate:translate_core_common",
52    #"//components/variations",  TODO(GYP)
53    "//content/public/common",
54    "//crypto",
55    "//extensions:extensions_resources",
56    "//extensions/strings",
57    #"//media/cast/cast.gyp:cast_transport",  TODO(GYP)
58    "//net",
59    "//skia",
60    "//third_party/icu",
61    "//third_party/libxml",
62    "//third_party/sqlite",
63    "//third_party/zlib:zip",
64    "//ui/resources:resources",
65    "//url",
66  ]
67
68  if (!is_ios) {
69    deps += [
70      #'<(DEPTH)/apps/common/api/api.gyp:apps_api',  TODO(GYP)
71      "//chrome/common/extensions/api",
72      #'<(DEPTH)/components/components.gyp:autofill_core_common',  TODO(GYP)
73      #'<(DEPTH)/components/components.gyp:autofill_content_common',  TODO(GYP)
74      #'<(DEPTH)/components/components.gyp:password_manager_core_common',  TODO(GYP)
75      #'<(DEPTH)/components/components.gyp:signin_core_common',  TODO(GYP)
76      #'<(DEPTH)/components/components.gyp:translate_content_common',  TODO(GYP)
77      #'<(DEPTH)/components/nacl.gyp:nacl_common',  TODO(GYP)
78      "//components/visitedlink/common",
79      #'<(DEPTH)/extensions/common/api/api.gyp:extensions_api',  TODO(GYP)
80      #'<(DEPTH)/extensions/extensions.gyp:extensions_common',  TODO(GYP)
81      "//ipc",
82      "//third_party/adobe/flash:flapper_version_h",
83      "//third_party/re2",
84      "//third_party/widevine/cdm:version_h",
85    ]
86  }
87}
88
89if (is_linux) {
90  action("version") {
91    visibility = ":common"
92    script = "//build/util/version.py"
93
94    lastchange_path = "//build/util/LASTCHANGE"
95    version_path = "//chrome/VERSION"
96    template_input_path = "chrome_version_info_posix.h.version"
97    if (is_chrome_branded) {
98      branding_path = "//chrome/app/theme/google_chrome/BRANDING"
99    } else {
100      branding_path = "//chrome/app/theme/chromium/BRANDING"
101    }
102
103    source_prereqs = [
104      version_path,
105      template_input_path,
106      lastchange_path,
107      branding_path,
108    ]
109
110    outfile = "$target_gen_dir/chrome_version_info_posix.h"
111    outputs = [ outfile ]
112
113    args = [
114      "-f", rebase_path(version_path, root_build_dir),
115      "-f", rebase_path(branding_path, root_build_dir),
116      "-f", rebase_path(lastchange_path, root_build_dir),
117      rebase_path(template_input_path, root_build_dir),
118      rebase_path(outfile, root_build_dir),
119    ]
120  }
121} else {
122  # Other platforms have a different way to do versioning.
123  group("version") {
124  }
125}
126
127# GN version: chrome/common_constants.gyp:common_constants
128static_library("constants") {
129  sources = [
130    "chrome_constants.cc",
131    "chrome_constants.h",
132    "chrome_icon_resources_win.cc",
133    "chrome_icon_resources_win.h",
134    "chrome_paths.cc",
135    "chrome_paths.h",
136    "chrome_paths_android.cc",
137    "chrome_paths_internal.h",
138    "chrome_paths_linux.cc",
139    "chrome_paths_mac.mm",
140    "chrome_paths_win.cc",
141    "chrome_switches.cc",
142    "chrome_switches.h",
143    "env_vars.cc",
144    "env_vars.h",
145    "net/test_server_locations.cc",
146    "net/test_server_locations.h",
147    "pref_font_script_names-inl.h",
148    "pref_font_webkit_names.h",
149    "pref_names.cc",
150    "pref_names.h",
151    "widevine_cdm_constants.cc",
152    "widevine_cdm_constants.h",
153  ]
154
155  deps = [
156    "//base",
157    "//base/third_party/dynamic_annotations",
158    "//third_party/widevine/cdm:version_h",
159    # TODO(GYP)
160    #'../components/components.gyp:bookmarks_common',
161    #'../components/nacl.gyp:nacl_switches',
162  ]
163}
164