summaryrefslogtreecommitdiff
path: root/chromium/services/shape_detection/BUILD.gn
blob: 6b5de944119e16c2376aa5ace33e1f60ed90a7ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# Copyright 2017 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.

import("//testing/test.gni")

source_set("lib") {
  sources = [
    "shape_detection_service.cc",
    "shape_detection_service.h",
    "text_detection_impl.h",
  ]

  if (is_mac) {
    sources += [
      "barcode_detection_impl_mac.h",
      "barcode_detection_impl_mac.mm",
      "barcode_detection_impl_mac_vision.h",
      "barcode_detection_impl_mac_vision.mm",
      "barcode_detection_impl_mac_vision_api.h",
      "barcode_detection_impl_mac_vision_api.mm",
      "barcode_detection_provider_mac.h",
      "barcode_detection_provider_mac.mm",
      "detection_utils_mac.h",
      "detection_utils_mac.mm",
      "face_detection_impl_mac.h",
      "face_detection_impl_mac.mm",
      "face_detection_impl_mac_vision.h",
      "face_detection_impl_mac_vision.mm",
      "face_detection_provider_mac.h",
      "face_detection_provider_mac.mm",
      "text_detection_impl_mac.h",
      "text_detection_impl_mac.mm",
    ]
    libs = [ "QuartzCore.framework" ]
  } else if (is_win) {
    sources += [
      "barcode_detection_provider_impl.cc",
      "barcode_detection_provider_impl.h",
      "detection_utils_win.cc",
      "detection_utils_win.h",
      "face_detection_impl_win.cc",
      "face_detection_impl_win.h",
      "face_detection_provider_win.cc",
      "face_detection_provider_win.h",
      "text_detection_impl_win.cc",
      "text_detection_impl_win.h",
    ]
  } else {
    sources += [
      "barcode_detection_provider_impl.cc",
      "barcode_detection_provider_impl.h",
      "face_detection_provider_impl.cc",
      "face_detection_provider_impl.h",
      "text_detection_impl.cc",
    ]
  }

  configs += [ "//build/config/compiler:wexit_time_destructors" ]

  deps = [
    "//mojo/public/cpp/bindings",
    "//ui/gfx",
    "//ui/gfx/geometry",
  ]

  public_deps = [
    "//base",
    "//media/capture",
    "//services/shape_detection/public/mojom",
  ]

  if (is_android) {
    deps += [ ":shape_detection_jni_headers" ]
  }
}

if (is_android) {
  generate_jni("shape_detection_jni_headers") {
    sources = [
      "android/java/src/org/chromium/shape_detection/InterfaceRegistrar.java",
    ]
  }

  android_library("shape_detection_java") {
    sources = [
      "android/java/src/org/chromium/shape_detection/BarcodeDetectionImpl.java",
      "android/java/src/org/chromium/shape_detection/BarcodeDetectionProviderImpl.java",
      "android/java/src/org/chromium/shape_detection/BitmapUtils.java",
      "android/java/src/org/chromium/shape_detection/FaceDetectionImpl.java",
      "android/java/src/org/chromium/shape_detection/FaceDetectionImplGmsCore.java",
      "android/java/src/org/chromium/shape_detection/FaceDetectionProviderImpl.java",
      "android/java/src/org/chromium/shape_detection/InterfaceRegistrar.java",
      "android/java/src/org/chromium/shape_detection/TextDetectionImpl.java",
    ]

    deps = [
      "$google_play_services_package:google_play_services_base_java",
      "$google_play_services_package:google_play_services_basement_java",
      "$google_play_services_package:google_play_services_vision_common_java",
      "$google_play_services_package:google_play_services_vision_java",
      "//base:base_java",
      "//mojo/public/java:base_java",
      "//mojo/public/java:bindings_java",
      "//mojo/public/java:system_java",
      "//mojo/public/java/system:system_impl_java",
      "//services/shape_detection/public/mojom:mojom_java",
      "//skia/public/mojom:mojom_java",
      "//ui/gfx/geometry/mojom:mojom_java",
    ]
  }
}

source_set("tests") {
  testonly = true
  sources = [
    "barcode_detection_impl_mac_unittest.mm",
    "barcode_detection_provider_mac_unittest.mm",
    "face_detection_impl_mac_unittest.mm",
    "face_detection_impl_win_unittest.cc",
    "text_detection_impl_mac_unittest.mm",
    "text_detection_impl_win_unittest.cc",
  ]
  if (is_mac) {
    libs = [
      "CoreFoundation.framework",
      "CoreGraphics.framework",
      "QuartzCore.framework",
    ]
  }

  deps = [
    ":lib",
    "//base",
    "//base/test:test_support",
    "//mojo/public/cpp/test_support:test_utils",
    "//skia",
    "//testing/gmock",
    "//testing/gtest",
    "//ui/gfx",
    "//ui/gl",
  ]
  data = [
    "//services/test/data/mona_lisa.jpg",
    "//services/test/data/text_detection.png",
    "//services/test/data/the_beatles.jpg",
  ]
}