[refactor] More post-NSS WebCrypto cleanups (utility functions).
[chromium-blink-merge.git] / gpu / gles2_conform_support / BUILD.gn
blob87f03624a38729a9a50975ac82f2b0c13584f7cf
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.
5 declare_args() {
6   # Set to true to compile with the OpenGL ES 2.0 conformance tests.
7   internal_gles2_conform_tests = false
10 import("//build/config/allocator.gni")
11 import("//testing/test.gni")
13 # GYP version: gpu/gles2_conform_support/gles2_conform_support.gyp:gles2_conform_support
14 executable("gles2_conform_support") {
15   sources = [
16     "gles2_conform_support.c",
17     "native/egl_native.cc",
18     "native/egl_native_win.cc",
19     "native/main.cc",
20   ]
21   defines = [
22     "GLES2_CONFORM_SUPPORT_ONLY",
23     "GTF_GLES20",
24     "EGLAPI=",
25     "EGLAPIENTRY=",
26   ]
27   deps = [
28     "//base",
29     "//base/third_party/dynamic_annotations",
30     "//build/config/sanitizers:deps",
31     "//gpu/command_buffer/client:gles2_c_lib_nocheck",
32     "//gpu/gles2_conform_support/egl",
33     "//ui/gl",
34   ]
35   if (is_linux) {
36     sources += [
37       "native/egl_native_aura.cc",
38       "native/egl_native_x11.cc",
39     ]
40   }
41   if (use_allocator != "none") {
42     # See http://crbug.com/162998#c4 for why this is needed.
43     deps += [ "//base/allocator" ]
44   }
47 if (internal_gles2_conform_tests) {
48   action("generate_gles2_conform_embedded_data") {
49     script = "generate_gles2_embedded_data.py"
50     outputs = [
51       "$target_gen_dir/gles2_conform_test_embedded_data/FilesDATA.c",
52       "$target_gen_dir/gles2_conform_test_embedded_data/FilesDATA.h",
53       "$target_gen_dir/gles2_conform_test_embedded_data/FilesTOC.c",
54     ]
55     args = [
56       rebase_path("//third_party/gles2_conform/GTF_ES/glsl/GTF"),
57       rebase_path("$target_gen_dir/gles2_conform_test_embedded_data"),
58     ]
59   }
60   gles2_conform_gypi =
61       exec_script("//build/gypi_to_gn.py",
62                   [
63                     rebase_path("gles2_conform.gypi"),
64                     "--replace=<(DEPTH)=../..",
65                     "--replace=<(SHARED_INTERMEDIATE_DIR)=$target_gen_dir",
66                   ],
67                   "scope",
68                   [ "gles2_conform.gypi" ])
69   executable("gles2_conform_test_windowless") {
70     testonly = true
72     # Include a dummy c++ file to force linking of libstdc++.
73     sources = [ "dummy.cc" ] + gles2_conform_gypi.gtf_es_sources
74     defines = [
75       "GTF_API=GTF_GLES20",
76       "HKEMBEDDEDFILESYSTEM",
77     ]
78     deps = [
79       ":generate_gles2_conform_embedded_data",
80       "//build/config/sanitizers:deps",
81       "//gpu/command_buffer/client:gles2_c_lib_nocheck",
82       "//gpu/gles2_conform_support/egl",
83       "//gpu/gles2_conform_support/native:windowless",
84     ]
85     configs += [ "//build/config/compiler:no_incompatible_pointer_warnings" ]
86     if (is_linux) {
87       if (!is_chromeos) {
88         deps += [ "//build/config/linux/gtk2" ]
90         if (is_clang) {
91           cflags = [
92             "-Wno-array-bounds",
93             "-Wno-implicit-function-declaration",
94             "-Wno-parentheses-equality",
95             "-Wno-pointer-sign",
96             "-Wno-return-type",
97             "-Wno-sizeof-pointer-memaccess",
98             "-Wno-tautological-compare",
99           ]
100         }
101       }
102     }
103     if (is_win) {
104       deps += [
105         "//third_party/angle:libEGL",
106         "//third_party/angle:libGLESv2",
107       ]
108       defines = [
109         "EGLAPI=",
110         "EGLAPIENTRY=",
111       ]
112       defines -= [ "NOMINMAX" ]
113       cflags = [
114         "/wd4018",  # signed/unsigned mismatch
115         "/wd4101",  # unreferenced local variable
116         "/wd4715",  # not all control paths return a value
117         "/wd4267",  # size_t/unsigned int conversion
118       ]
119     }
120     if (is_mac) {
121       defines = [
122         "_STDINT",
123         "_STDINT_H",
124       ]
125       if (is_clang) {
126         cflags = [
127           "-Wno-pointer-sign",
128           "-Wno-array-bounds",
129           "-Wno-sizeof-pointer-memaccess",
130           "-Wno-implicit-function-declaration",
131           "-Wno-logical-op-parentheses",
132           "-Wno-tautological-compare",
133           "-Wno-parentheses-equality",
134           "-Wno-return-type",
135         ]
136         #"xcode_settings": {
137         #"LD": "clang++",
138         #"WARNING_CFLAGS": [
139         #"-Wno-pointer-sign",
140         #"-Wno-array-bounds",
141         #"-Wno-sizeof-pointer-memaccess",
142         #"-Wno-implicit-function-declaration",
143         #"-Wno-logical-op-parentheses",
144         #"-Wno-tautological-compare",
145         #"-Wno-parentheses-equality",
146         #"-Wno-return-type",
147         #],
148         #},
149       }
150     }
152     #'run_as': {
153     #     'conditions': [
154     #       ['OS=="win"', {
155     #         'action': [
156     #           '$(TargetPath)',
157     #           '-noimagefileio',
158     #           '-run=<(DEPTH)/third_party/gles2_conform/GTF_ES/glsl/GTF/mustpass.run',
159     #         ],
160     #       }],
161     #     ],
162     #    },
163   }
166 # TODO(GYP): Delete this after we've converted everything to GN.
167 # The _run targets exist only for compatibility w/ GYP.
168 group("gles2_conform_test_run") {
169   testonly = true
170   deps = [
171     ":gles2_conform_test",
172   ]
175 test("gles2_conform_test") {
176   sources = [
177     "gles2_conform_test.cc",
178   ]
179   deps = [
180     "//base",
181     "//gpu/config",
182     "//testing/gtest",
183   ]
185   data = [
186     "gles2_conform_test_expectations.txt",
187   ]
189   if (internal_gles2_conform_tests) {
190     deps += [ ":gles2_conform_test_windowless" ]
191     # TODO: Make these tests pull in the correct data dependencies once they
192     # are exported in GN. Maybe from  //third_party/gles2_conform/GTF_ES/
193   }