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 Vertex.hpp 50 VertexProcessor.cpp 51 VertexProcessor.hpp 52) 53 54add_library(vk_device EXCLUDE_FROM_ALL 55 ${DEVICE_SRC_FILES} 56) 57 58set_target_properties(vk_device PROPERTIES 59 POSITION_INDEPENDENT_CODE 1 60 FOLDER "SwiftShader VK" 61) 62 63target_include_directories(vk_device 64 PUBLIC 65 ".." 66 "${SWIFTSHADER_DIR}/include" 67) 68 69target_compile_options(vk_device 70 PRIVATE 71 ${ROOT_PROJECT_COMPILE_OPTIONS} 72) 73 74target_link_options(vk_device 75 PUBLIC 76 ${SWIFTSHADER_LINK_FLAGS} 77) 78 79target_link_libraries(vk_device 80 PUBLIC 81 vk_pipeline 82 $<$<BOOL:${SWIFTSHADER_ENABLE_ASTC}>:astc-encoder> 83) 84