Rebaseline global-interface-listing-expected.txt
[chromium-blink-merge.git] / gpu / gles2_conform_support / BUILD.gn
bloba0874a7c7d60658ee8e9f60e766108723e0b1c83
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     "//gpu/gles2_conform_support/egl",
30     "//base/third_party/dynamic_annotations",
31     "//ui/gl",
32     "//gpu/command_buffer/client:gles2_c_lib_nocheck",
33   ]
34   if (is_linux) {
35     sources += [
36       "native/egl_native_aura.cc",
37       "native/egl_native_x11.cc",
38     ]
39   }
40   if (use_allocator != "none") {
41     # See http://crbug.com/162998#c4 for why this is needed.
42     deps += [ "//base/allocator" ]
43   }
46 if (internal_gles2_conform_tests) {
47   action("generate_gles2_conform_embedded_data") {
48     script = "generate_gles2_embedded_data.py"
49     output = [
50       "$target_gen_dir/gles2_conform_test_embedded_data/FilesData.c",
51       "$target_gen_dir/gles2_conform_test_embedded_data/FilesData.h",
52       "$target_gen_dir/gles2_conform_test_embedded_data/FilesTOC.c",
53     ]
54     args = [
55       "../../third_party/gles2_conform/GTF_ES/glsl/GTF",
56       "$target_gen_dir/gles2_conform_test_embedded_data",
57     ]
58   }
59   gles2_conform_gypi = exec_script("//build/gypi_to_gn.py",
60                                    [ rebase_path("gles2_conform_gypi") ],
61                                    "scoped",
62                                    [ "gles2_conform_gypi" ])
63   executable("gles2_conform_test_windowless") {
64     testonly = true
65     sources = [
66       # Include a dummy c++ file to force linking of libstdc++.
67       "dummy.cc",
68       gles2_conform_gypi.gtf_es_sources,
69     ]
70     defines = [
71       "GTF_API=GTF_GLES20",
72       "HKEMBEDDEDFILESYSTEM",
73     ]
74     deps = [
75       ":generate_gles2_conform_embedded_data",
76       "//gpu/gles2_conform_support/egl",
77       "//gpu/gles2_conform_support/native:windowless",
78       "//gpu/command_buffer/client:gles2_c_libnocheck",
79     ]
80     configs += [ "//build/compiler:no_incompatible_pointer_warnings" ]
81     if (is_linux) {
82       if (!is_chromeos) {
83         deps += [ "//build/linux/system/gtk" ]
85         if (is_clang) {
86           cflags = [
87             "-Wno-array-bounds",
88             "-Wno-implicit-function-declaration",
89             "-Wno-parentheses-equality",
90             "-Wno-pointer-sign",
91             "-Wno-return-type",
92             "-Wno-sizeof-pointer-memaccess",
93             "-Wno-tautological-compare",
94           ]
95         }
96       }
97     }
98     if (is_win) {
99       deps += [
100         "//third_party/angle:libEGL",
101         "//third_party/angle:libGLESv2",
102       ]
103       defines = [
104         "EGLAPI=",
105         "EGLAPIENTRY=",
106       ]
107       defines -= [ "NOMINMAX" ]
108       cflags = [
109         "/wd4018",  # signed/unsigned mismatch
110         "/wd4101",  # unreferenced local variable
111         "/wd4715",  # not all control paths return a value
112         "/wd4267",  # size_t/unsigned int conversion
113       ]
114     }
115     if (is_mac) {
116       defines = [
117         "_STDINT",
118         "_STDINT_H",
119       ]
120       if (is_clang) {
121         cflags = [
122           "-Wno-pointer-sign",
123           "-Wno-array-bounds",
124           "-Wno-sizeof-pointer-memaccess",
125           "-Wno-implicit-function-declaration",
126           "-Wno-logical-op-parentheses",
127           "-Wno-tautological-compare",
128           "-Wno-parentheses-equality",
129           "-Wno-return-type",
130         ]
131         #"xcode_settings": {
132         #"LD": "clang++",
133         #"WARNING_CFLAGS": [
134         #"-Wno-pointer-sign",
135         #"-Wno-array-bounds",
136         #"-Wno-sizeof-pointer-memaccess",
137         #"-Wno-implicit-function-declaration",
138         #"-Wno-logical-op-parentheses",
139         #"-Wno-tautological-compare",
140         #"-Wno-parentheses-equality",
141         #"-Wno-return-type",
142         #],
143         #},
144       }
145     }
147     #'run_as': {
148     #     'conditions': [
149     #       ['OS=="win"', {
150     #         'action': [
151     #           '$(TargetPath)',
152     #           '-noimagefileio',
153     #           '-run=<(DEPTH)/third_party/gles2_conform/GTF_ES/glsl/GTF/mustpass.run',
154     #         ],
155     #       }],
156     #     ],
157     #    },
158   }
161 # TODO(GYP): Delete this after we've converted everything to GN.
162 # The _run targets exist only for compatibility w/ GYP.
163 group("gles2_conform_test_run") {
164   testonly = true
165   deps = [
166     ":gles2_conform_test",
167   ]
170 test("gles2_conform_test") {
171   sources = [
172     "gles2_conform_test.cc",
173   ]
174   deps = [
175     "//base",
176     "//gpu/config",
177     "//testing/gtest",
178   ]
180   data = [
181     "gles2_conform_test_expectations.txt",
182   ]
184   if (internal_gles2_conform_tests) {
185     deps += [ "gles2_conform_test_windowless" ]
187     data_deps = [ "//third_party/gles2_conform/GTF_ES/" ]
188   }