OSDN Git Service

Update to gn files for Windows
[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_clang) {
18     cflags = [
19       "-DLOG_TAG=\"swiftshader_libGLESv2\"",
20       "-fno-operator-names",
21       "-D__STDC_CONSTANT_MACROS",
22       "-D__STDC_LIMIT_MACROS",
23       "-DGL_API=",
24       "-DGL_APICALL=",
25       "-DGL_GLEXT_PROTOTYPES",
26       "-Wno-sign-compare",
27     ]
28   } else {
29     if (host_os == "win") {
30       cflags = [
31         "/DGL_API=",
32         "/DGL_APICALL=",
33         "/DGL_GLEXT_PROTOTYPES",
34         "/DLIBGLESV2_EXPORTS",
35         "/wd4201", # nameless struct/union
36         "/wd4324", # structure was padded due to alignment specifier
37       ]
38     }
39   }
40
41   if (!is_debug) {
42     cflags += [
43       "-DANGLE_DISABLE_TRACE",
44     ]
45   }
46 }
47
48 shared_library("swiftshader_libGLESv2") {
49   deps = [
50     "../../Common:swiftshader_common",
51     "../../Reactor:swiftshader_reactor",
52     "../../Renderer:swiftshader_renderer",
53     "../../OpenGL/common:swiftshader_opengl_common",
54     "../../OpenGL/compiler:swiftshader_opengl_compiler",
55     "../../Shader:swiftshader_shader",
56     "../../Main:swiftshader_main",
57     "../../../third_party/LLVM:swiftshader_llvm",
58   ]
59
60   sources = [
61     "Buffer.cpp",
62     "Context.cpp",
63     "Device.cpp",
64     "Fence.cpp",
65     "Framebuffer.cpp",
66     "IndexDataManager.cpp",
67     "libGLESv2.cpp",
68     "libGLESv3.cpp",
69     "main.cpp",
70     "Program.cpp",
71     "Query.cpp",
72     "Renderbuffer.cpp",
73     "ResourceManager.cpp",
74     "Shader.cpp",
75     "Texture.cpp",
76     "TransformFeedback.cpp",
77     "utilities.cpp",
78     "VertexArray.cpp",
79     "VertexDataManager.cpp",
80   ]
81
82   if (host_os == "win") {
83     configs -= [
84       "//build/config/win:unicode"
85     ]
86   }
87
88   configs += [
89     ":swiftshader_libGLESv2_private_config",
90   ]
91
92   include_dirs = [
93     "../../../include",
94     "../..",
95     "..",
96   ]
97 }