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(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 34 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" 62) 63 64target_include_directories(vk_device 65 PUBLIC 66 ".." 67 "${SWIFTSHADER_DIR}/include" 68) 69 70target_compile_options(vk_device 71 PRIVATE 72 ${ROOT_PROJECT_COMPILE_OPTIONS} 73) 74 75target_link_options(vk_device 76 PUBLIC 77 ${SWIFTSHADER_LINK_FLAGS} 78) 79 80target_link_libraries(vk_device 81 PUBLIC 82 vk_pipeline 83 $<$<BOOL:${SWIFTSHADER_ENABLE_ASTC}>:astc-encoder> 84) 85