Home | History | Annotate | Download | only in unittests
      1 # Copyright 2016 The SwiftShader Authors. All Rights Reserved.
      2 #
      3 # Licensed under the Apache License, Version 2.0 (the "License");
      4 # you may not use this file except in compliance with the License.
      5 # You may obtain a copy of the License at
      6 #
      7 #    http://www.apache.org/licenses/LICENSE-2.0
      8 #
      9 # Unless required by applicable law or agreed to in writing, software
     10 # distributed under the License is distributed on an "AS IS" BASIS,
     11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     12 # See the License for the specific language governing permissions and
     13 # limitations under the License.
     14 
     15 import("//testing/test.gni")
     16 
     17 test("swiftshader_unittests") {
     18   deps = [
     19     "//base",
     20     "//base/test:test_support",
     21     "//testing/gmock",
     22     "//testing/gtest",
     23     "//third_party/swiftshader/src/OpenGL/libEGL:swiftshader_libEGL",
     24     "//third_party/swiftshader/src/OpenGL/libGLESv2:swiftshader_libGLESv2",
     25   ]
     26 
     27   sources = [
     28     "//gpu/swiftshader_tests_main.cc",
     29     "unittests.cpp",
     30   ]
     31 
     32   include_dirs = [ "../../include" ]  # Khronos headers
     33 
     34   defines = [ "GL_GLEXT_PROTOTYPES" ]
     35 
     36   # Make sure we're loading SwiftShader's libraries, not ANGLE's or the system
     37   # provided ones. On Windows an explicit LoadLibrary("swiftshader\lib*.dll")
     38   # is required before making the first EGL or OpenGL ES call.
     39   if (is_win) {
     40     ldflags = [
     41       "/DELAYLOAD:libEGL.dll",
     42       "/DELAYLOAD:libGLESv2.dll",
     43     ]
     44   } else if (is_mac) {
     45     ldflags = [
     46       "-rpath",
     47       "@executable_path/",
     48     ]
     49   } else {
     50     ldflags = [ "-Wl,-rpath=\$ORIGIN/swiftshader" ]
     51   }
     52 }
     53