• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2020 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
15set(ROOT_PROJECT_COMPILE_OPTIONS
16    ${SWIFTSHADER_COMPILE_OPTIONS}
17    ${WARNINGS_AS_ERRORS}
18)
19
20set(ROOT_PROJECT_LINK_LIBRARIES
21    ${OS_LIBS}
22    ${SWIFTSHADER_LIBS}
23)
24
25set(OPENGL_COMPILER_SRC_FILES
26    AnalyzeCallDepth.cpp
27    AnalyzeCallDepth.h
28    BaseTypes.h
29    Common.h
30    Compiler.cpp
31    Compiler.h
32    ConstantUnion.h
33    debug.cpp
34    debug.h
35    Diagnostics.cpp
36    Diagnostics.h
37    DirectiveHandler.cpp
38    DirectiveHandler.h
39    ExtensionBehavior.h
40    glslang_lex.cpp
41    glslang_tab.cpp
42    glslang_tab.h
43    glslang.h
44    InfoSink.cpp
45    InfoSink.h
46    Initialize.cpp
47    Initialize.h
48    InitializeGlobals.h
49    InitializeParseContext.cpp
50    InitializeParseContext.h
51    Intermediate.cpp
52    intermediate.h
53    intermOut.cpp
54    IntermTraverse.cpp
55    localintermediate.h
56    MMap.h
57    osinclude.h
58    OutputASM.cpp
59    OutputASM.h
60    parseConst.cpp
61    ParseHelper.cpp
62    ParseHelper.h
63    PoolAlloc.cpp
64    PoolAlloc.h
65    Pragma.h
66    preprocessor/DiagnosticsBase.cpp
67    preprocessor/DiagnosticsBase.h
68    preprocessor/DirectiveHandlerBase.cpp
69    preprocessor/DirectiveHandlerBase.h
70    preprocessor/DirectiveParser.cpp
71    preprocessor/DirectiveParser.h
72    preprocessor/ExpressionParser.cpp
73    preprocessor/ExpressionParser.h
74    preprocessor/Input.cpp
75    preprocessor/Input.h
76    preprocessor/length_limits.h
77    preprocessor/Lexer.cpp
78    preprocessor/Lexer.h
79    preprocessor/Macro.cpp
80    preprocessor/Macro.h
81    preprocessor/MacroExpander.cpp
82    preprocessor/MacroExpander.h
83    preprocessor/numeric_lex.h
84    preprocessor/pp_utils.h
85    preprocessor/Preprocessor.cpp
86    preprocessor/Preprocessor.h
87    preprocessor/SourceLocation.h
88    preprocessor/Token.cpp
89    preprocessor/Token.h
90    preprocessor/Tokenizer.cpp
91    preprocessor/Tokenizer.h
92    SymbolTable.cpp
93    SymbolTable.h
94    TranslatorASM.cpp
95    TranslatorASM.h
96    Types.h
97    util.cpp
98    util.h
99    ValidateLimitations.cpp
100    ValidateLimitations.h
101    ValidateSwitch.cpp
102    ValidateSwitch.h
103)
104
105if(WIN32)
106    list(APPEND OPENGL_COMPILER_SRC_FILES
107        ossource_win.cpp
108    )
109elseif(LINUX)
110    list(APPEND OPENGL_COMPILER_SRC_FILES
111        ossource_posix.cpp
112    )
113elseif(APPLE)
114    list(APPEND OPENGL_COMPILER_SRC_FILES
115        ossource_posix.cpp
116    )
117elseif(ANDROID)
118    list(APPEND OPENGL_COMPILER_SRC_FILES
119        ossource_posix.cpp
120    )
121endif()
122
123add_library(GLCompiler
124    ${OPENGL_COMPILER_SRC_FILES}
125)
126
127set_target_properties(GLCompiler PROPERTIES
128    POSITION_INDEPENDENT_CODE 1
129    FOLDER "OpenGL"
130)
131
132target_include_directories(GLCompiler
133    PRIVATE
134        ".."
135        "${SWIFTSHADER_DIR}/include"
136        "${SWIFTSHADER_DIR}/src"
137)
138
139target_compile_definitions(GLCompiler
140    PRIVATE
141)
142
143target_compile_options(GLCompiler
144    PRIVATE
145        ${ROOT_PROJECT_COMPILE_OPTIONS}
146)
147
148target_link_options(GLCompiler
149    PUBLIC
150        ${SWIFTSHADER_LINK_FLAGS}
151)
152
153target_link_libraries(GLCompiler
154    PRIVATE
155        ${ROOT_PROJECT_LINK_LIBRARIES}
156)
157