blob: 29040172dff881e75b2e2a7049ed0a7917f3fa39 [file] [log] [blame]
Antonio Maiorano9418b512020-04-08 23:18:13 -04001# 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(DEVICE_SRC_FILES
21 ASTC_Decoder.cpp
22 ASTC_Decoder.hpp
23 BC_Decoder.cpp
24 BC_Decoder.hpp
25 Blitter.cpp
26 Blitter.hpp
27 Clipper.cpp
28 Clipper.hpp
29 Config.hpp
30 Context.cpp
31 Context.hpp
32 ETC_Decoder.cpp
33 ETC_Decoder.hpp
Antonio Maiorano9418b512020-04-08 23:18:13 -040034 Memset.hpp
35 PixelProcessor.cpp
36 PixelProcessor.hpp
37 Polygon.hpp
38 Primitive.hpp
39 QuadRasterizer.cpp
40 QuadRasterizer.hpp
41 Rasterizer.hpp
42 Renderer.cpp
43 Renderer.hpp
44 RoutineCache.hpp
45 Sampler.hpp
46 SetupProcessor.cpp
47 SetupProcessor.hpp
48 Stream.hpp
49 Triangle.hpp
50 Vertex.hpp
51 VertexProcessor.cpp
52 VertexProcessor.hpp
53)
54
55add_library(vk_device EXCLUDE_FROM_ALL
56 ${DEVICE_SRC_FILES}
57)
58
59set_target_properties(vk_device PROPERTIES
60 POSITION_INDEPENDENT_CODE 1
61 FOLDER "SwiftShader VK"
Antonio Maiorano9418b512020-04-08 23:18:13 -040062)
63
64target_include_directories(vk_device
65 PUBLIC
66 ".."
Antonio Maiorano8772b422020-04-15 15:00:36 -040067 "${SWIFTSHADER_DIR}/include"
Antonio Maiorano9418b512020-04-08 23:18:13 -040068)
69
70target_compile_options(vk_device
Antonio Maiorano47d09cb2020-04-15 13:11:38 -040071 PRIVATE
Antonio Maiorano9418b512020-04-08 23:18:13 -040072 ${ROOT_PROJECT_COMPILE_OPTIONS}
73)
74
Antonio Maiorano63aa9542020-04-20 17:52:01 -040075target_link_options(vk_device
76 PUBLIC
77 ${SWIFTSHADER_LINK_FLAGS}
78)
79
Antonio Maiorano9418b512020-04-08 23:18:13 -040080target_link_libraries(vk_device
81 PUBLIC
82 vk_pipeline
Antonio Maioranoceb62582020-04-21 13:25:10 -040083 $<$<BOOL:${SWIFTSHADER_ENABLE_ASTC}>:astc-encoder>
Antonio Maiorano9418b512020-04-08 23:18:13 -040084)