OSDN Git Service

80adf837c78ee59c264fe6d7495bec5fd7fa1c00
[android-x86/external-swiftshader.git] / src / OpenGL / libGLESv2 / BUILD.gn
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 # Need a separate config to ensure the warnings are added to the end.
16 config("swiftshader_libGLESv2_private_config") {
17   if (is_win) {
18     cflags = [
19       "/DGL_API=",
20       "/DGL_APICALL=",
21       "/DGL_GLEXT_PROTOTYPES",
22       "/DLIBGLESV2_EXPORTS",
23       "/wd4201",  # nameless struct/union
24       "/wd4324",  # structure was padded due to alignment specifier
25     ]
26
27     if (is_clang) {
28       cflags += [
29         "-D__STDC_CONSTANT_MACROS",
30         "-D__STDC_LIMIT_MACROS",
31       ]
32     }
33   } else {
34     cflags = [
35       "-DLOG_TAG=\"swiftshader_libGLESv2\"",
36       "-D__STDC_CONSTANT_MACROS",
37       "-D__STDC_LIMIT_MACROS",
38       "-DGL_API=",
39       "-DGL_APICALL=__attribute__((visibility(\"protected\")))",
40       "-DGL_GLEXT_PROTOTYPES",
41       "-Wno-sign-compare",
42     ]
43   }
44 }
45
46 shared_library("swiftshader_libGLESv2") {
47   if (!is_mac) {
48     output_name = "libGLESv2"
49     output_dir = "$root_out_dir/swiftshader"
50   }
51
52   deps = [
53     "../../OpenGL/compiler:swiftshader_opengl_compiler",
54     "../../Reactor:swiftshader_reactor",
55     "../../Renderer:swiftshader_renderer",
56   ]
57
58   sources = [
59     "Buffer.cpp",
60     "Context.cpp",
61     "Device.cpp",
62     "Fence.cpp",
63     "Framebuffer.cpp",
64     "IndexDataManager.cpp",
65     "Program.cpp",
66     "Query.cpp",
67     "Renderbuffer.cpp",
68     "ResourceManager.cpp",
69     "Shader.cpp",
70     "Texture.cpp",
71     "TransformFeedback.cpp",
72     "VertexArray.cpp",
73     "VertexDataManager.cpp",
74     "libGLESv2.cpp",
75     "libGLESv2.def",
76     "libGLESv2.rc",
77     "libGLESv3.cpp",
78     "main.cpp",
79     "resource.h",
80     "utilities.cpp",
81   ]
82
83   if (is_win) {
84     configs -= [ "//build/config/win:unicode" ]
85     ldflags = [ "/DEF:" + rebase_path("libGLESv2.def", root_build_dir) ]
86   } else if (is_linux) {
87     ldflags =
88         [ "-Wl,--version-script=" + rebase_path("exports.map", root_build_dir) ]
89   }
90
91   configs -= [ "//build/config/compiler:chromium_code" ]
92   configs += [
93     "//build/config/compiler:no_chromium_code",
94     "//third_party/swiftshader:swiftshader_config",
95     ":swiftshader_libGLESv2_private_config",
96   ]
97
98   include_dirs = [
99     "../../../include",
100     "../..",
101     "..",
102   ]
103 }