• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2021 The ANGLE Project 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#
5# Build configuration for OpenCL-related targets.
6
7import("../../gni/angle.gni")
8
9assert(angle_enable_cl)
10
11if (is_win || is_linux) {
12  glesv2_path =
13      rebase_path(get_label_info("$angle_root:libGLESv2", "root_out_dir"))
14}
15
16angle_shared_library("OpenCL_ANGLE") {
17  defines = [ "LIBCL_IMPLEMENTATION" ]
18  if (is_win) {
19    defines += [ "ANGLE_GLESV2_LIBRARY_PATH=\"" +
20                 string_replace(glesv2_path, "/", "\\\\") + "\"" ]
21  }
22
23  sources = [
24    "dispatch.cpp",
25    "dispatch.h",
26    "libOpenCL_autogen.cpp",
27  ]
28
29  configs += [
30    "$angle_root:debug_annotations_config",
31    "$angle_root:library_name_config",
32  ]
33
34  deps = [
35    "$angle_root:angle_common",
36    "$angle_root:cl_includes",
37  ]
38
39  if (is_linux) {
40    inputs = [ "libOpenCL_autogen.map" ]
41    ldflags = [
42      "-Wl,--version-script=" +
43          rebase_path("libOpenCL_autogen.map", root_build_dir),
44      "-Wl,-rpath=" + glesv2_path,
45    ]
46  }
47}
48
49group("angle_cl") {
50  data_deps = [ ":OpenCL_ANGLE" ]
51}
52