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 15import("//testing/test.gni") 16import("../../src/swiftshader.gni") 17 18if (build_with_chromium) { 19 test("swiftshader_unittests") { 20 deps = [ 21 "//base", 22 "//base/test:test_support", 23 "//testing/gmock", 24 "//testing/gtest", 25 "//third_party/googletest:gmock", 26 "//third_party/googletest:gtest", 27 "//third_party/swiftshader/src/OpenGL/libEGL:swiftshader_libEGL", 28 "//third_party/swiftshader/src/OpenGL/libGLESv2:swiftshader_libGLESv2", 29 ] 30 31 sources = [ 32 "//gpu/swiftshader_tests_main.cc", 33 "unittests.cpp", 34 ] 35 36 include_dirs = [ "../../include" ] # Khronos headers 37 38 defines = [ 39 "GL_GLEXT_PROTOTYPES", 40 "GL_APICALL=", 41 "GLAPI=", 42 ] 43 44 # Make sure we're loading SwiftShader's libraries, not ANGLE's or the system 45 # provided ones. On Windows an explicit LoadLibrary("swiftshader\lib*.dll") 46 # is required before making the first EGL or OpenGL ES call. 47 if (is_win) { 48 ldflags = [ 49 "/DELAYLOAD:libEGL.dll", 50 "/DELAYLOAD:libGLESv2.dll", 51 ] 52 } else if (is_mac) { 53 ldflags = [ 54 "-rpath", 55 "@executable_path/", 56 ] 57 frameworks = [ 58 "CoreFoundation.framework", 59 "IOSurface.framework", 60 ] 61 } else { 62 ldflags = [ "-Wl,-rpath=\$ORIGIN/swiftshader" ] 63 } 64 } 65} 66