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("//build/toolchain/toolchain.gni")
17 # Need a separate config to ensure the warnings are added to the end.
18 config("swiftshader_libEGL_private_config") {
19 defines = [ "EGL_EGLEXT_PROTOTYPES" ]
23 "/wd4201", # nameless struct/union
24 "/wd4065", # switch statement contains 'default' but no 'case' labels
25 "/wd5030", # attribute is not recognized
33 cflags = [ "-Wno-sign-compare" ]
35 cflags += [ "-Wno-unused-but-set-variable" ]
39 "LOG_TAG=\"swiftshader_libEGL\"",
40 "EGLAPI=__attribute__((visibility(\"default\")))",
45 shared_library("swiftshader_libEGL") {
47 output_name = "libEGL"
48 output_dir = "$root_out_dir/swiftshader"
52 "//build/config:exe_and_shlib_deps",
56 "../common/Object.cpp",
68 sources += [ "../common/debug.cpp" ]
72 sources += [ "OSXUtils.mm" ]
78 configs -= [ "//build/config/win:unicode" ]
79 ldflags = [ "/DEF:" + rebase_path("libGLESv2.def", root_build_dir) ]
80 } else if (is_linux) {
82 "../../Main/libX11.cpp",
85 [ "-Wl,--version-script=" + rebase_path("exports.map", root_build_dir) ]
89 # https://crbug.com/686980
90 # This target relies on the linker to be smart and garbage collect unused symbols.
91 # It is not the case for LLD + ThinLTO, so we have to use this ugly workaround.
95 "-fno-whole-program-vtables",
100 configs -= [ "//build/config/compiler:chromium_code" ]
102 "//build/config/compiler:no_chromium_code",
103 "//third_party/swiftshader:swiftshader_config",
104 ":swiftshader_libEGL_private_config",