# 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", "//gpu/gles2_conform_support/egl", "//base/third_party/dynamic_annotations", "//ui/gl", "//gpu/command_buffer/client:gles2_c_lib_nocheck", ] 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" output = [ "$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 = [ "../../third_party/gles2_conform/GTF_ES/glsl/GTF", "$target_gen_dir/gles2_conform_test_embedded_data", ] } gles2_conform_gypi = exec_script("//build/gypi_to_gn.py", [ rebase_path("gles2_conform_gypi") ], "scoped", [ "gles2_conform_gypi" ]) executable("gles2_conform_test_windowless") { testonly = true sources = [ # Include a dummy c++ file to force linking of libstdc++. "dummy.cc", gles2_conform_gypi.gtf_es_sources, ] defines = [ "GTF_API=GTF_GLES20", "HKEMBEDDEDFILESYSTEM", ] deps = [ ":generate_gles2_conform_embedded_data", "//gpu/gles2_conform_support/egl", "//gpu/gles2_conform_support/native:windowless", "//gpu/command_buffer/client:gles2_c_libnocheck", ] configs += [ "//build/compiler:no_incompatible_pointer_warnings" ] if (is_linux) { if (!is_chromeos) { deps += [ "//build/linux/system/gtk" ] 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" ] data_deps = [ "//third_party/gles2_conform/GTF_ES/" ] } }