OSDN Git Service

Update to gn files for Windows
[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   } else {
23     if (host_os == "win") {
24       cflags = [
25         "/wd4005", # macro redefinition (in autogenerated code)
26         "/wd4201", # nameless struct/union
27         "/wd4267", # conversion from size_t to int/unsigned int
28         "/wd4702", # unreachable code (in autogenerated code)
29       ]
30     }
31   }
32
33   if (!is_debug) {
34     cflags += [
35       "-DANGLE_DISABLE_TRACE",
36     ]
37   }
38 }
39
40 source_set("swiftshader_opengl_compiler") {
41   deps = [
42     "preprocessor:swiftshader_opengl_preprocessor",
43   ]
44
45   sources = [
46     "AnalyzeCallDepth.cpp",
47     "Compiler.cpp",
48     "debug.cpp",
49     "Diagnostics.cpp",
50     "DirectiveHandler.cpp",
51     "glslang_lex.cpp",
52     "glslang_tab.cpp",
53     "InfoSink.cpp",
54     "Initialize.cpp",
55     "InitializeParseContext.cpp",
56     "IntermTraverse.cpp",
57     "Intermediate.cpp",
58     "intermOut.cpp",
59     "OutputASM.cpp",
60     "parseConst.cpp",
61     "ParseHelper.cpp",
62     "PoolAlloc.cpp",
63     "SymbolTable.cpp",
64     "TranslatorASM.cpp",
65     "util.cpp",
66     "ValidateGlobalInitializer.cpp",
67     "ValidateLimitations.cpp",
68     "ValidateSwitch.cpp",
69   ]
70
71   if ((host_os == "linux") || (host_os == "mac")) {
72     sources += [
73       "ossource_posix.cpp",
74     ]
75   } else if (host_os == "win") {
76     sources += [
77       "ossource_win.cpp",
78     ]
79   }
80
81   configs += [
82     ":swiftshader_opengl_compiler_private_config",
83   ]
84
85   include_dirs = [
86     "..",
87     "../..",
88     "../../../include",
89   ]
90 }