blob: 87f03624a38729a9a50975ac82f2b0c13584f7cf [file] [log] [blame]
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
declare_args() {
# Set to true to compile with the OpenGL ES 2.0 conformance tests.
internal_gles2_conform_tests = false
}
import("//build/config/allocator.gni")
import("//testing/test.gni")
# GYP version: gpu/gles2_conform_support/gles2_conform_support.gyp:gles2_conform_support
executable("gles2_conform_support") {
sources = [
"gles2_conform_support.c",
"native/egl_native.cc",
"native/egl_native_win.cc",
"native/main.cc",
]
defines = [
"GLES2_CONFORM_SUPPORT_ONLY",
"GTF_GLES20",
"EGLAPI=",
"EGLAPIENTRY=",
]
deps = [
"//base",
"//base/third_party/dynamic_annotations",
"//build/config/sanitizers:deps",
"//gpu/command_buffer/client:gles2_c_lib_nocheck",
"//gpu/gles2_conform_support/egl",
"//ui/gl",
]
if (is_linux) {
sources += [
"native/egl_native_aura.cc",
"native/egl_native_x11.cc",
]
}
if (use_allocator != "none") {
# See http://crbug.com/162998#c4 for why this is needed.
deps += [ "//base/allocator" ]
}
}
if (internal_gles2_conform_tests) {
action("generate_gles2_conform_embedded_data") {
script = "generate_gles2_embedded_data.py"
outputs = [
"$target_gen_dir/gles2_conform_test_embedded_data/FilesDATA.c",
"$target_gen_dir/gles2_conform_test_embedded_data/FilesDATA.h",
"$target_gen_dir/gles2_conform_test_embedded_data/FilesTOC.c",
]
args = [
rebase_path("//third_party/gles2_conform/GTF_ES/glsl/GTF"),
rebase_path("$target_gen_dir/gles2_conform_test_embedded_data"),
]
}
gles2_conform_gypi =
exec_script("//build/gypi_to_gn.py",
[
rebase_path("gles2_conform.gypi"),
"--replace=<(DEPTH)=../..",
"--replace=<(SHARED_INTERMEDIATE_DIR)=$target_gen_dir",
],
"scope",
[ "gles2_conform.gypi" ])
executable("gles2_conform_test_windowless") {
testonly = true
# Include a dummy c++ file to force linking of libstdc++.
sources = [ "dummy.cc" ] + gles2_conform_gypi.gtf_es_sources
defines = [
"GTF_API=GTF_GLES20",
"HKEMBEDDEDFILESYSTEM",
]
deps = [
":generate_gles2_conform_embedded_data",
"//build/config/sanitizers:deps",
"//gpu/command_buffer/client:gles2_c_lib_nocheck",
"//gpu/gles2_conform_support/egl",
"//gpu/gles2_conform_support/native:windowless",
]
configs += [ "//build/config/compiler:no_incompatible_pointer_warnings" ]
if (is_linux) {
if (!is_chromeos) {
deps += [ "//build/config/linux/gtk2" ]
if (is_clang) {
cflags = [
"-Wno-array-bounds",
"-Wno-implicit-function-declaration",
"-Wno-parentheses-equality",
"-Wno-pointer-sign",
"-Wno-return-type",
"-Wno-sizeof-pointer-memaccess",
"-Wno-tautological-compare",
]
}
}
}
if (is_win) {
deps += [
"//third_party/angle:libEGL",
"//third_party/angle:libGLESv2",
]
defines = [
"EGLAPI=",
"EGLAPIENTRY=",
]
defines -= [ "NOMINMAX" ]
cflags = [
"/wd4018", # signed/unsigned mismatch
"/wd4101", # unreferenced local variable
"/wd4715", # not all control paths return a value
"/wd4267", # size_t/unsigned int conversion
]
}
if (is_mac) {
defines = [
"_STDINT",
"_STDINT_H",
]
if (is_clang) {
cflags = [
"-Wno-pointer-sign",
"-Wno-array-bounds",
"-Wno-sizeof-pointer-memaccess",
"-Wno-implicit-function-declaration",
"-Wno-logical-op-parentheses",
"-Wno-tautological-compare",
"-Wno-parentheses-equality",
"-Wno-return-type",
]
#"xcode_settings": {
#"LD": "clang++",
#"WARNING_CFLAGS": [
#"-Wno-pointer-sign",
#"-Wno-array-bounds",
#"-Wno-sizeof-pointer-memaccess",
#"-Wno-implicit-function-declaration",
#"-Wno-logical-op-parentheses",
#"-Wno-tautological-compare",
#"-Wno-parentheses-equality",
#"-Wno-return-type",
#],
#},
}
}
#'run_as': {
# 'conditions': [
# ['OS=="win"', {
# 'action': [
# '$(TargetPath)',
# '-noimagefileio',
# '-run=<(DEPTH)/third_party/gles2_conform/GTF_ES/glsl/GTF/mustpass.run',
# ],
# }],
# ],
# },
}
}
# TODO(GYP): Delete this after we've converted everything to GN.
# The _run targets exist only for compatibility w/ GYP.
group("gles2_conform_test_run") {
testonly = true
deps = [
":gles2_conform_test",
]
}
test("gles2_conform_test") {
sources = [
"gles2_conform_test.cc",
]
deps = [
"//base",
"//gpu/config",
"//testing/gtest",
]
data = [
"gles2_conform_test_expectations.txt",
]
if (internal_gles2_conform_tests) {
deps += [ ":gles2_conform_test_windowless" ]
# TODO: Make these tests pull in the correct data dependencies once they
# are exported in GN. Maybe from //third_party/gles2_conform/GTF_ES/
}
}