1 # Copyright 2016 The SwiftShader Authors. All Rights Reserved.
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
7 # http://www.apache.org/licenses/LICENSE-2.0
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.
15 import("../../swiftshader.gni")
17 # Need a separate config to ensure the warnings are added to the end.
18 config("swiftshader_libGLESv2_private_config") {
21 "GL_GLEXT_PROTOTYPES",
26 "/wd4201", # nameless struct/union
27 "/wd4324", # structure was padded due to alignment specifier
28 "/wd5030", # attribute is not recognized
38 "__STDC_CONSTANT_MACROS",
39 "__STDC_LIMIT_MACROS",
43 cflags = [ "-Wno-sign-compare" ]
45 cflags += [ "-Wno-unused-but-set-variable" ]
49 "__STDC_CONSTANT_MACROS",
50 "__STDC_LIMIT_MACROS",
51 "GL_APICALL=__attribute__((visibility(\"default\"))) __attribute__((no_sanitize(\"function\")))",
57 swiftshader_static_library("swiftshader_libGLESv2_static") {
59 "../../OpenGL/compiler:swiftshader_opengl_compiler",
60 "../../Reactor:swiftshader_reactor",
61 "../../Renderer:swiftshader_renderer",
70 "IndexDataManager.cpp",
74 "ResourceManager.cpp",
77 "TransformFeedback.cpp",
79 "VertexDataManager.cpp",
87 configs = [ ":swiftshader_libGLESv2_private_config" ]
96 swiftshader_shared_library("swiftshader_libGLESv2") {
97 if (!is_mac && !is_fuchsia) {
98 output_name = "libGLESv2"
99 output_dir = "$root_out_dir/swiftshader"
103 ":swiftshader_libGLESv2_static",
104 "//build/config:exe_and_shlib_deps",
114 ldflags = [ "/DEF:" + rebase_path("libGLESv2.def", root_build_dir) ]
117 "CoreFoundation.framework",
118 "IOSurface.framework",
120 ldflags = [ "-Wl,-install_name,@rpath/libswiftshader_libGLESv2.dylib" ]
121 } else if (is_linux) {
123 [ "-Wl,--version-script=" + rebase_path("libGLESv2.lds", root_build_dir) ]
126 configs = [ ":swiftshader_libGLESv2_private_config" ]