Hash :
7107a0f3
Author :
Date :
2021-05-16T15:37:44
CL: Load OpenCL without search path modification Make it possible to load libGLESv2 and OpenCL_ANGLE without adding ANGLE's binary directory to the search path. Bug: angleproject:5904 Change-Id: Ie810466b39e1101e4da5b9fd199d26683b129281 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2897250 Commit-Queue: John Plate <jplate@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
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
# Copyright 2021 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# Build configuration for OpenCL-related targets.
import("../../gni/angle.gni")
assert(angle_enable_cl)
cl_library_name = "OpenCL_ANGLE"
if (is_win || is_linux) {
glesv2_path =
rebase_path(get_label_info("$angle_root:libGLESv2", "root_out_dir"))
}
config("opencl_library_name") {
if (is_win) {
defines = [ "ANGLE_OPENCL_LIB_NAME=\"" + cl_library_name + "\"" ]
} else {
defines = [ "ANGLE_OPENCL_LIB_NAME=\"lib" + cl_library_name + "\"" ]
}
}
angle_shared_library(cl_library_name) {
defines = [ "LIBCL_IMPLEMENTATION" ]
if (is_win) {
defines += [ "ANGLE_GLESV2_LIBRARY_PATH=\"" +
string_replace(glesv2_path, "/", "\\\\") + "\"" ]
}
sources = [
"dispatch.cpp",
"dispatch.h",
"libOpenCL_autogen.cpp",
]
configs += [
"$angle_root:debug_annotations_config",
"$angle_root:library_name_config",
]
deps = [
"$angle_root:angle_common",
"$angle_root:cl_includes",
]
if (is_linux) {
inputs = [ "libOpenCL_autogen.map" ]
ldflags = [
"-Wl,--version-script=" +
rebase_path("libOpenCL_autogen.map", root_build_dir),
"-Wl,-rpath=" + glesv2_path,
]
}
}
group("angle_cl") {
data_deps = [ ":$cl_library_name" ]
}