OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
| 5 import("//build/config/chrome_build.gni") |
5 import("//chrome/version.gni") | 6 import("//chrome/version.gni") |
6 | 7 |
7 if (is_ios) { | 8 declare_args() { |
8 declare_args() { | 9 if (is_ios) { |
9 # Path to the file used to override the version PATH level on iOS. | 10 # Path to the file used to override the version PATH level on iOS. |
10 # Default to ios/build/util/VERSION. | 11 # Default to ios/build/util/VERSION. |
11 ios_extra_version_path = "//ios/build/util/VERSION" | 12 ios_extra_version_path = "//ios/build/util/VERSION" |
12 } | 13 } |
| 14 |
| 15 use_unofficial_version_number = !is_chrome_branded |
13 } | 16 } |
14 | 17 |
15 source_set("version_info") { | 18 source_set("version_info") { |
16 sources = [ | 19 sources = [ |
17 "version_info.cc", | 20 "version_info.cc", |
18 "version_info.h", | 21 "version_info.h", |
19 ] | 22 ] |
20 | 23 |
21 deps = [ | 24 deps = [ |
22 "//base", | 25 "//base", |
23 "//components/strings", | 26 "//components/strings", |
24 "//ui/base", | |
25 ] | 27 ] |
26 | 28 |
| 29 if (use_unofficial_version_number) { |
| 30 defines = [ "USE_UNOFFICIAL_VERSION_NUMBER" ] |
| 31 deps += [ "//ui/base" ] |
| 32 } |
| 33 |
27 public_deps = [ | 34 public_deps = [ |
28 ":generate_version_info", | 35 ":generate_version_info", |
29 ] | 36 ] |
30 } | 37 } |
31 | 38 |
32 process_version("generate_version_info") { | 39 process_version("generate_version_info") { |
33 visibility = [ ":version_info" ] | 40 visibility = [ ":version_info" ] |
34 template_file = "version_info_values.h.version" | 41 template_file = "version_info_values.h.version" |
35 output = "$target_gen_dir/version_info_values.h" | 42 output = "$target_gen_dir/version_info_values.h" |
36 | 43 |
37 if (is_ios) { | 44 if (is_ios) { |
38 # iOS overrides PATCH level of the version with the value from the file | 45 # iOS overrides PATCH level of the version with the value from the file |
39 # named by ios_version_path, however, this needs to be the last argument | 46 # named by ios_version_path, however, this needs to be the last argument |
40 # to the version.py script, so it cannot be added to the sources variable | 47 # to the version.py script, so it cannot be added to the sources variable |
41 # and instead need to be managed manually. | 48 # and instead need to be managed manually. |
42 | 49 |
43 inputs = [ | 50 inputs = [ |
44 ios_extra_version_path, | 51 ios_extra_version_path, |
45 ] | 52 ] |
46 extra_args = [ | 53 extra_args = [ |
47 "-f", | 54 "-f", |
48 rebase_path(ios_extra_version_path, root_build_dir), | 55 rebase_path(ios_extra_version_path, root_build_dir), |
49 ] | 56 ] |
50 } | 57 } |
51 } | 58 } |
OLD | NEW |