BUILD.gn 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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
  3. # found in the LICENSE file.
  4. import("//build/config/chrome_build.gni")
  5. import("//build/util/lastchange.gni")
  6. import("//build/util/process_version.gni")
  7. declare_args() {
  8. use_unofficial_version_number = !is_chrome_branded
  9. }
  10. static_library("version_info") {
  11. sources = [
  12. "version_info.cc",
  13. "version_info.h",
  14. ]
  15. deps = [
  16. "//base",
  17. "//base:sanitizer_buildflags",
  18. "//build:branding_buildflags",
  19. "//build:chromeos_buildflags",
  20. ]
  21. public_deps = [
  22. ":channel",
  23. ":generate_version_info",
  24. ]
  25. }
  26. # Isolate the //ui/base dependency in this target.
  27. static_library("version_string") {
  28. sources = [
  29. "version_string.cc",
  30. "version_string.h",
  31. ]
  32. deps = [
  33. ":version_info",
  34. "//components/strings",
  35. ]
  36. if (use_unofficial_version_number) {
  37. defines = [ "USE_UNOFFICIAL_VERSION_NUMBER" ]
  38. deps += [ "//ui/base" ]
  39. }
  40. }
  41. source_set("channel") {
  42. sources = [ "channel.h" ]
  43. }
  44. process_version("generate_version_info") {
  45. template_file = "version_info_values.h.version"
  46. sources = [
  47. "//chrome/VERSION",
  48. branding_file_path,
  49. lastchange_file,
  50. ]
  51. output = "$target_gen_dir/version_info_values.h"
  52. }