xref: /aosp_15_r20/external/angle/third_party/OpenCL-CTS/gn/angle_ocl_cts.gni (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1# Copyright 2024 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
5import("//gni/angle.gni")
6
7template("ocl_cts_source_set") {
8  angle_source_set(target_name) {
9    cflags = [
10      "-Wno-deprecated-declarations",
11      "-Wno-#warnings",
12      "-Wno-format",
13      "-Wno-vla-cxx-extension",
14      "-Wno-deprecated-volatile",
15      "-Wno-c++11-narrowing",
16    ]
17    defines = [ "CL_TARGET_OPENCL_VERSION=300" ]
18
19    # Rename main() to avoid conflict with the gtest-based main()
20    defines += [ "main=ANGLE_oclcts_main" ]
21    deps = [
22      "$angle_root:cl_includes",
23      "$angle_root/third_party/OpenCL-CTS/gn:test_common",
24      "$angle_root/third_party/OpenCL-ICD-Loader:opencl_icd_loader",
25    ]
26    suppressed_configs += [
27      "//build/config/compiler:chromium_code",
28      "//build/config/compiler:no_exceptions",
29      "//build/config/compiler:no_rtti",
30      "$angle_root:extra_warnings",
31      "$angle_root:constructor_and_destructor_warnings",
32    ]
33    include_dirs = [
34      "$angle_root/third_party/OpenCL-CTS/src/test_common",
35      "$angle_root/third_party/OpenCL-CTS/src/test_common/autotest",
36      "$angle_root/third_party/OpenCL-CTS/src/test_common/harness",
37      "$angle_root/third_party/OpenCL-CTS/src/test_common/miniz",
38      "$angle_root/third_party/OpenCL-ICD-Loader/src/loader",
39    ]
40
41    forward_variables_from(invoker,
42                           "*",
43                           [
44                             "configs",
45                             "deps",
46                             "include_dirs",
47                             "cflags",
48                           ])
49    if (defined(invoker.configs)) {
50      configs += invoker.configs
51    }
52    if (defined(invoker.deps)) {
53      deps += invoker.deps
54    }
55    if (defined(invoker.include_dirs)) {
56      include_dirs += invoker.include_dirs
57    }
58    if (defined(invoker.cflags)) {
59      cflags += invoker.cflags
60    }
61  }
62}
63