Home | History | Annotate | Download | only in GLESUnitTests
      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 = [
     35     "GL_GLEXT_PROTOTYPES",
     36     "GL_APICALL=",
     37     "GLAPI=",
     38   ]
     39 
     40   # Make sure we're loading SwiftShader's libraries, not ANGLE's or the system
     41   # provided ones. On Windows an explicit LoadLibrary("swiftshader\lib*.dll")
     42   # is required before making the first EGL or OpenGL ES call.
     43   if (is_win) {
     44     ldflags = [
     45       "/DELAYLOAD:libEGL.dll",
     46       "/DELAYLOAD:libGLESv2.dll",
     47     ]
     48   } else if (is_mac) {
     49     ldflags = [
     50       "-rpath",
     51       "@executable_path/",
     52     ]
     53     libs = [
     54       "CoreFoundation.framework",
     55       "IOSurface.framework",
     56     ]
     57   } else {
     58     ldflags = [ "-Wl,-rpath=\$ORIGIN/swiftshader" ]
     59   }
     60 }
     61