OSDN Git Service

a7b4c2b3dc18f98c7f5961cc8d67a10398ded1ea
[android-x86/external-swiftshader.git] / src / OpenGL / compiler / 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_opengl_compiler_private_config") {
17   if (is_clang) {
18     cflags = [
19       "-DLOG_TAG=\"swiftshader_opengl_compiler\"",
20       "-Wno-sign-compare",
21     ]
22
23     if (!is_debug) {
24       cflags += [
25         "-DNDEBUG",
26         "-DANGLE_DISABLE_TRACE",
27       ]
28     }
29   }
30 }
31
32 source_set("swiftshader_opengl_compiler") {
33   deps = [
34     "preprocessor:swiftshader_opengl_preprocessor",
35   ]
36
37   sources = [
38     "AnalyzeCallDepth.cpp",
39     "Compiler.cpp",
40     "debug.cpp",
41     "Diagnostics.cpp",
42     "DirectiveHandler.cpp",
43     "glslang_lex.cpp",
44     "glslang_tab.cpp",
45     "InfoSink.cpp",
46     "Initialize.cpp",
47     "InitializeParseContext.cpp",
48     "IntermTraverse.cpp",
49     "Intermediate.cpp",
50     "intermOut.cpp",
51     "OutputASM.cpp",
52     "parseConst.cpp",
53     "ParseHelper.cpp",
54     "PoolAlloc.cpp",
55     "SymbolTable.cpp",
56     "TranslatorASM.cpp",
57     "util.cpp",
58     "ValidateGlobalInitializer.cpp",
59     "ValidateLimitations.cpp",
60     "ValidateSwitch.cpp",
61   ]
62
63   if ((host_os == "linux") || (host_os == "mac")) {
64     sources += [
65       "ossource_posix.cpp",
66     ]
67   } else if (host_os == "win") {
68     sources += [
69       "ossource_win.cpp",
70     ]
71   }
72
73   configs += [
74     ":swiftshader_opengl_compiler_private_config",
75   ]
76
77   include_dirs = [
78     "..",
79     "../..",
80     "../../../include",
81   ]
82 }