Commit 319ba630 authored by vchigrin's avatar vchigrin Committed by Commit bot

Add targets for generating version files in Windows GN build.

Now chrome_version.cc  and version .rc files are generated.

Review URL: https://codereview.chromium.org/874413003

Cr-Commit-Position: refs/heads/master@{#313798}
parent c67de28b
......@@ -31,6 +31,7 @@ if (!is_android) {
if (is_win) {
sources += [
"$target_gen_dir/chrome_exe_version.rc",
"app/chrome_exe_main_win.cc",
"app/client_util.cc",
"app/client_util.h",
......@@ -39,6 +40,7 @@ if (!is_android) {
"//content/app/startup_helper_win.cc",
]
deps += [
":chrome_version_resources",
":image_pre_reader",
"//chrome/browser:chrome_process_finder",
"//chrome/chrome_watcher",
......@@ -146,7 +148,7 @@ shared_library("main_dll") {
deps += [
# On Windows, link the dependencies (libraries) that make up actual
# Chromium functionality into this .dll.
#'chrome_version_resources', TODO(GYP)
":chrome_version_resources",
"//chrome/app/theme:chrome_unscaled_resources",
"//chrome_elf",
"//content/app/resources",
......@@ -260,6 +262,51 @@ if (is_win) {
output = "$root_gen_dir/version.h"
}
process_version("chrome_exe_version") {
source = "//chrome/app/chrome_version.rc.version"
output = "$target_gen_dir/chrome_exe_version.rc"
extra_args = [
"-f",
rebase_path("app/chrome_exe.ver", root_build_dir),
]
}
process_version("chrome_dll_version") {
source = "//chrome/app/chrome_version.rc.version"
output = "$target_gen_dir/chrome_dll_version.rc"
extra_args = [
"-f",
rebase_path("app/chrome_dll.ver", root_build_dir),
]
}
process_version("nacl64_exe_version") {
source = "//chrome/app/chrome_version.rc.version"
output = "$target_gen_dir/nacl64_exe_version.rc"
extra_args = [
"-f",
rebase_path("app/nacl64_exe.ver", root_build_dir),
]
}
process_version("other_version") {
source = "//chrome/app/chrome_version.rc.version"
output = "$target_gen_dir/other_version.rc"
extra_args = [
"-f",
rebase_path("app/other.ver", root_build_dir),
]
}
group("chrome_version_resources") {
deps = [
":chrome_exe_version",
":chrome_dll_version",
":nacl64_exe_version",
":other_version",
]
}
source_set("image_pre_reader") {
sources = [
"app/image_pre_reader_win.cc",
......
......@@ -237,6 +237,11 @@ process_version("version") {
output = "$target_gen_dir/chrome_version_info_values.h"
}
process_version("make_chrome_version") {
source = "chrome_version.cc.version"
output = "$target_gen_dir/chrome_version.cc"
}
# GN version: chrome/common_constants.gyp:common_constants
static_library("constants") {
sources = [
......@@ -264,8 +269,10 @@ static_library("constants") {
"widevine_cdm_constants.cc",
"widevine_cdm_constants.h",
]
sources += get_target_outputs(":make_chrome_version")
deps = [
":make_chrome_version",
"//base",
"//base/third_party/dynamic_annotations",
"//components/bookmarks/common",
......
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/common/chrome_constants.h"
namespace chrome {
const char kChromeVersion[] = "@MAJOR@.@MINOR@.@BUILD@.@PATCH@";
} // namespace chrome
......@@ -41,20 +41,25 @@
{
'action_name': 'Make chrome_version.cc',
'variables': {
'make_version_cc_path': 'tools/build/make_version_cc.py',
'lastchange_path': '<(DEPTH)/build/util/LASTCHANGE',
'template_input_path': 'common/chrome_version.cc.version',
},
'inputs': [
'<(make_version_cc_path)',
'VERSION',
'<(version_py_path)',
'<(version_path)',
'<(lastchange_path)',
'<(template_input_path)',
],
'outputs': [
'<(INTERMEDIATE_DIR)/chrome_version.cc',
],
'action': [
'python',
'<(make_version_cc_path)',
'<(version_py_path)',
'-f', '<(version_path)',
'-f', '<(lastchange_path)',
'<(template_input_path)',
'<@(_outputs)',
'<(version_full)',
],
'process_outputs_as_sources': 1,
},
......
......@@ -372,15 +372,14 @@ if (!is_android) {
# direct_dependent_settings in their various targets
# (net.gyp:net_resources, etc.), but that causes errors in other
# targets when resulting .res files get referenced multiple times.
#"$root_gen_dir/chrome_version/other_version.rc", TODO(GYP) what generates this?
"$root_gen_dir/chrome/other_version.rc",
"$root_gen_dir/ui/resources/ui_unscaled_resources.rc",
]
deps += [
"//chrome:chrome_version_resources",
"//third_party/isimpledom",
"//third_party/wtl",
"//ui/resources",
# 'chrome.gyp:chrome_version_resources' TODO(GYP)
]
}
......@@ -840,11 +839,11 @@ if (!is_android) {
}
if (is_win) {
sources += [
#'<(SHARED_INTERMEDIATE_DIR)/chrome_version/other_version.rc', TODO(GYP)
"$root_gen_dir/chrome/other_version.rc",
"$root_gen_dir/ui/resources/ui_unscaled_resources.rc",
]
deps += [
#'chrome_version_resources', TODO(GYP)
"//chrome:chrome_version_resources",
"//third_party/wtl",
"//ui/resources",
]
......@@ -1072,14 +1071,13 @@ if (!is_android) {
}
if (is_win) {
sources += [
#'<(SHARED_INTERMEDIATE_DIR)/chrome_version/other_version.rc', TODO(GYP)
"$root_gen_dir/chrome/other_version.rc",
"$root_gen_dir/ui/resources/ui_unscaled_resources.rc",
]
deps += [
"//chrome:chrome_version_resources",
"//third_party/wtl",
"//ui/resources",
#'chrome_version_resources', TODO(GYP)
]
} else {
sources -= [ "../app/chrome_version.rc.version" ]
......@@ -1139,14 +1137,13 @@ if (!is_android) {
}
if (is_win) {
sources += [
#'<(SHARED_INTERMEDIATE_DIR)/chrome_version/other_version.rc', TODO(GYP)
"$root_gen_dir/chrome/other_version.rc",
"$root_gen_dir/ui/resources/ui_unscaled_resources.rc",
]
deps += [
"//chrome:chrome_version_resources",
"//third_party/wtl",
"//ui/resources",
#'chrome_version_resources', TODO(GYP)
]
} else {
sources -= [ "../app/chrome_version.rc.version" ]
......
#!/usr/bin/env python
# Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Creates chrome_version.cc which contains the definition of the
# kChromeVersion constant.
import sys
def main(me, args):
if len(args) != 2:
print >>sys.stderr, 'usage: %s version.cc version' % me
return 1
(cc_file, version) = args
contents = '''// automatically generated by %s
#include "chrome/common/chrome_constants.h"
namespace chrome {
const char kChromeVersion[] = "%s";
} // namespace chrome
''' % (me, version)
output = open(cc_file, 'w')
output.write(contents)
output.close()
return 0
if __name__ == '__main__':
sys.exit(main(sys.argv[0], sys.argv[1:]))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment