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(SHADER_SRC_FILES
21    Constants.cpp
22    PixelPipeline.cpp
23    PixelProgram.cpp
24    PixelRoutine.cpp
25    PixelShader.cpp
26    SamplerCore.cpp
27    SetupRoutine.cpp
28    Shader.cpp
29    ShaderCore.cpp
30    VertexPipeline.cpp
31    VertexProgram.cpp
32    VertexRoutine.cpp
33    VertexShader.cpp
34    Constants.hpp
35    PixelPipeline.hpp
36    PixelProgram.hpp
37    PixelRoutine.hpp
38    PixelShader.hpp
39    SamplerCore.hpp
40    SetupRoutine.hpp
41    Shader.hpp
42    ShaderCore.hpp
43    VertexPipeline.hpp
44    VertexProgram.hpp
45    VertexRoutine.hpp
46    VertexShader.hpp
47)
48
49add_library(gl_shader EXCLUDE_FROM_ALL
50    ${SHADER_SRC_FILES}
51)
52
53set_target_properties(gl_shader PROPERTIES
54    POSITION_INDEPENDENT_CODE 1
55    FOLDER "SwiftShader GL"
56)
57
58target_include_directories(gl_shader
59    PUBLIC
60        ".."
61)
62
63target_compile_definitions(gl_shader
64    PRIVATE
65        "NO_SANITIZE_FUNCTION="
66)
67
68target_compile_options(gl_shader
69    PRIVATE
70        ${ROOT_PROJECT_COMPILE_OPTIONS}
71)
72
73target_link_options(gl_shader
74    PUBLIC
75        ${SWIFTSHADER_LINK_FLAGS}
76)
77
78target_link_libraries(gl_shader
79    PUBLIC
80        gl_main
81)
82