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
5source_set("thunk") {
6  # In GYP this is the same target as shared_impl. In GN these are split apart
7  # for clarity but to get component builds correct, targets must only depend
8  # on these via the shared_impl component.
9  # TODO(brettw) separate these when GYP compat is no longer required.
10  visibility = [ "//ppapi/shared_impl" ]
11
12  sources = [
13    "enter.cc",
14    "enter.h",
15    "interfaces_legacy.h",
16    "interfaces_postamble.h",
17    "interfaces_ppb_private.h",
18    "interfaces_ppb_private_flash.h",
19    "interfaces_ppb_private_no_permissions.h",
20    "interfaces_ppb_public_dev.h",
21    "interfaces_ppb_public_dev_channel.h",
22    "interfaces_ppb_public_socket.h",
23    "interfaces_ppb_public_stable.h",
24    "interfaces_preamble.h",
25    "ppapi_thunk_export.h",
26    "ppb_audio_api.h",
27    "ppb_audio_buffer_api.h",
28    "ppb_audio_buffer_thunk.cc",
29    "ppb_audio_config_api.h",
30    "ppb_audio_config_thunk.cc",
31    "ppb_audio_input_api.h",
32    "ppb_audio_output_api.h",
33    "ppb_audio_thunk.cc",
34    "ppb_browser_font_singleton_api.h",
35    "ppb_browser_font_trusted_api.h",
36    "ppb_buffer_api.h",
37    "ppb_camera_capabilities_api.h",
38    "ppb_camera_capabilities_private_thunk.cc",
39    "ppb_camera_device_api.h",
40    "ppb_camera_device_private_thunk.cc",
41    "ppb_console_thunk.cc",
42    "ppb_cursor_control_thunk.cc",
43    "ppb_device_ref_api.h",
44    "ppb_device_ref_dev_thunk.cc",
45    "ppb_ext_crx_file_system_private_thunk.cc",
46    "ppb_file_chooser_api.h",
47    "ppb_file_chooser_dev_thunk.cc",
48    "ppb_file_chooser_trusted_thunk.cc",
49    "ppb_file_io_api.h",
50    "ppb_file_io_private_thunk.cc",
51    "ppb_file_io_thunk.cc",
52    "ppb_file_ref_api.h",
53    "ppb_file_ref_thunk.cc",
54    "ppb_file_system_api.h",
55    "ppb_file_system_thunk.cc",
56    "ppb_find_private_thunk.cc",
57    "ppb_flash_font_file_api.h",
58    "ppb_flash_fullscreen_api.h",
59    "ppb_fullscreen_thunk.cc",
60    "ppb_gamepad_api.h",
61    "ppb_gamepad_thunk.cc",
62    "ppb_graphics_2d_api.h",
63    "ppb_graphics_2d_thunk.cc",
64    "ppb_graphics_3d_api.h",
65    "ppb_graphics_3d_thunk.cc",
66    "ppb_host_resolver_api.h",
67    "ppb_host_resolver_private_api.h",
68    "ppb_host_resolver_private_thunk.cc",
69    "ppb_host_resolver_thunk.cc",
70    "ppb_image_data_api.h",
71    "ppb_image_data_thunk.cc",
72    "ppb_input_event_api.h",
73    "ppb_input_event_thunk.cc",
74    "ppb_instance_api.h",
75    "ppb_instance_private_thunk.cc",
76    "ppb_instance_thunk.cc",
77    "ppb_isolated_file_system_private_api.h",
78    "ppb_isolated_file_system_private_thunk.cc",
79    "ppb_media_stream_audio_track_api.h",
80    "ppb_media_stream_audio_track_thunk.cc",
81    "ppb_media_stream_video_track_api.h",
82    "ppb_media_stream_video_track_thunk.cc",
83    "ppb_message_loop_api.h",
84    "ppb_messaging_thunk.cc",
85    "ppb_mouse_cursor_thunk.cc",
86    "ppb_mouse_lock_thunk.cc",
87    "ppb_net_address_api.h",
88    "ppb_net_address_thunk.cc",
89    "ppb_network_list_api.h",
90    "ppb_network_list_thunk.cc",
91    "ppb_network_monitor_api.h",
92    "ppb_network_monitor_thunk.cc",
93    "ppb_network_proxy_api.h",
94    "ppb_network_proxy_thunk.cc",
95    "ppb_pdf_api.h",
96    "ppb_printing_api.h",
97    "ppb_printing_dev_thunk.cc",
98    "ppb_tcp_server_socket_private_api.h",
99    "ppb_tcp_server_socket_private_thunk.cc",
100    "ppb_tcp_socket_api.h",
101    "ppb_tcp_socket_private_api.h",
102    "ppb_tcp_socket_private_thunk.cc",
103    "ppb_tcp_socket_thunk.cc",
104    "ppb_text_input_thunk.cc",
105    "ppb_udp_socket_api.h",
106    "ppb_udp_socket_private_api.h",
107    "ppb_udp_socket_private_thunk.cc",
108    "ppb_udp_socket_thunk.cc",
109    "ppb_uma_private_thunk.cc",
110    "ppb_uma_singleton_api.h",
111    "ppb_url_loader_api.h",
112    "ppb_url_loader_thunk.cc",
113    "ppb_url_loader_trusted_thunk.cc",
114    "ppb_url_request_info_api.h",
115    "ppb_url_request_info_thunk.cc",
116    "ppb_url_response_info_api.h",
117    "ppb_url_response_info_thunk.cc",
118    "ppb_var_array_thunk.cc",
119    "ppb_var_dictionary_thunk.cc",
120    "ppb_video_capture_api.h",
121    "ppb_video_decoder_api.h",
122    "ppb_video_decoder_dev_api.h",
123    "ppb_video_decoder_thunk.cc",
124    "ppb_video_encoder_api.h",
125    "ppb_video_encoder_thunk.cc",
126    "ppb_video_frame_api.h",
127    "ppb_video_frame_thunk.cc",
128    "ppb_view_api.h",
129    "ppb_view_dev_thunk.cc",
130    "ppb_view_thunk.cc",
131    "ppb_vpn_provider_api.h",
132    "ppb_vpn_provider_thunk.cc",
133    "ppb_websocket_api.h",
134    "ppb_websocket_thunk.cc",
135    "ppb_x509_certificate_private_api.h",
136    "ppb_x509_certificate_private_thunk.cc",
137    "resource_creation_api.h",
138    "thunk.h",
139  ]
140
141  if (!is_nacl) {
142    sources += [
143      "ppb_audio_input_dev_thunk.cc",
144      "ppb_audio_output_dev_thunk.cc",
145      "ppb_browser_font_trusted_thunk.cc",
146      "ppb_buffer_thunk.cc",
147      "ppb_char_set_thunk.cc",
148      "ppb_flash_font_file_thunk.cc",
149      "ppb_gles_chromium_texture_mapping_thunk.cc",
150      "ppb_pdf_thunk.cc",
151      "ppb_url_util_thunk.cc",
152      "ppb_video_capture_thunk.cc",
153      "ppb_video_decoder_dev_thunk.cc",
154    ]
155  }
156
157  # This condition is catching the build of nacl64.exe, which is built in
158  # the 64-bit toolchain when the overall build is 32-bit.  We exclude a
159  # few more things, to avoid pulling in more dependencies.
160  # See also //ppapi/shared_impl
161  if (is_win && target_cpu == "x86" && current_cpu == "x64") {
162    sources -= [
163      "ppb_graphics_3d_thunk.cc",
164      "ppb_host_resolver_private_thunk.cc",
165      "ppb_tcp_server_socket_private_thunk.cc",
166      "ppb_tcp_socket_private_thunk.cc",
167      "ppb_udp_socket_private_thunk.cc",
168      "ppb_x509_certificate_private_thunk.cc",
169    ]
170  }
171
172  configs += [ "//build/config:precompiled_headers" ]
173  defines = [
174    # This target goes in the same library as shared_impl (in GYP they are the
175    # same).
176    "PPAPI_SHARED_IMPLEMENTATION",
177
178    "PPAPI_THUNK_IMPLEMENTATION",
179  ]
180
181  public_deps = [ "//base" ]
182}
183