1# Codec common sources 2add_subdirectory(apigen-codec-common) 3add_subdirectory(compressedTextureFormats) 4 5# Vulkan 6add_subdirectory(vulkan) 7 8# GLES translator 9add_subdirectory(glestranslator) 10add_subdirectory(libGLSnapshot) 11 12# GLES decoder 13add_subdirectory(gles1_dec) 14add_subdirectory(gles2_dec) 15 16# GLES dispatch based on Translator 17add_subdirectory(OpenGLESDispatch) 18 19# RenderControl decoder 20add_subdirectory(renderControl_dec) 21 22# Stream server core 23set(stream-server-core-sources 24 ChannelStream.cpp 25 ColorBuffer.cpp 26 CompositorVk.cpp 27 DisplayVk.cpp 28 FbConfig.cpp 29 FenceSync.cpp 30 GLESVersionDetector.cpp 31 PostWorker.cpp 32 ReadbackWorker.cpp 33 ReadBuffer.cpp 34 render_api.cpp 35 RenderChannelImpl.cpp 36 RenderThreadInfo.cpp 37 RingStream.cpp 38 SwapChainStateVk.cpp 39 SyncThread.cpp 40 TextureDraw.cpp 41 TextureResize.cpp 42 WindowSurface.cpp 43 YUVConverter.cpp 44 RenderThread.cpp 45 RenderContext.cpp 46 RenderControl.cpp 47 RenderWindow.cpp 48 RenderLibImpl.cpp 49 RendererImpl.cpp 50 FrameBuffer.cpp) 51if (APPLE) 52 set(stream-server-core-platform-sources NativeSubWindow_cocoa.m) 53elseif (WIN32) 54 set(stream-server-core-platform-sources NativeSubWindow_win32.cpp) 55else() 56 set(stream-server-core-platform-sources NativeSubWindow_x11.cpp) 57endif() 58 59add_library( 60 gfxstream_backend 61 SHARED 62 ${stream-server-core-sources} 63 ${stream-server-core-platform-sources} 64 GfxStreamAgents.cpp 65 GfxStreamBackend.cpp 66 virtio-gpu-gfxstream-renderer.cpp) 67target_link_libraries( 68 gfxstream_backend 69 PUBLIC 70 gfxstream-host-common 71 gfxstream-base 72 OpenGLESDispatch 73 gles1_dec 74 gles2_dec 75 renderControl_dec 76 gfxstream-vulkan-server 77 gfxstream-snapshot 78 apigen-codec-common 79 perfetto-tracing-only) 80 81if (WIN32) 82 target_link_libraries(gfxstream_backend PRIVATE D3d9.lib) 83 target_link_options(gfxstream_backend PRIVATE /DEBUG) 84endif() 85 86target_include_directories( 87 gfxstream_backend 88 PUBLIC 89 ${GFXSTREAM_REPO_ROOT} 90 ${GFXSTREAM_REPO_ROOT}/include 91 ${GFXSTREAM_REPO_ROOT}/stream-servers 92 ${GFXSTREAM_REPO_ROOT}/stream-servers/apigen-codec-common 93 ${GFXSTREAM_REPO_ROOT}/stream-servers/vulkan) 94android_install_shared(gfxstream_backend) 95 96# Testing libraries 97add_subdirectory(testlibs) 98 99# Backend unit tests 100add_executable( 101 gfxstream_backend_unittests 102 gfxstream_unittest.cpp) 103target_link_libraries( 104 gfxstream_backend_unittests 105 PRIVATE 106 OSWindow 107 gfxstream_backend 108 gfxstream-base 109 gtest_main) 110 111# More functional tests######################################################### 112 113# Common testing support library################################################ 114# This includes the server core and testing sources 115add_library( 116 stream-server-testing-support 117 ${stream-server-core-sources} 118 ${stream-server-core-platform-sources} 119 tests/SampleApplication.cpp 120 tests/GLSnapshotTesting.cpp 121 tests/OpenGLTestContext.cpp 122 tests/GLTestUtils.cpp 123 tests/ShaderUtils.cpp 124 tests/GLSnapshotTestDispatch.cpp 125 tests/GLSnapshotTestStateUtils.cpp 126 tests/HelloTriangleImp.cpp) 127target_include_directories( 128 stream-server-testing-support 129 PRIVATE 130 ${GFXSTREAM_REPO_ROOT} 131 PUBLIC 132 ${GFXSTREAM_REPO_ROOT}/base/testing 133 ${GFXSTREAM_REPO_ROOT} 134 ${GFXSTREAM_REPO_ROOT}/include 135 ${GFXSTREAM_REPO_ROOT}/stream-servers 136 ${GFXSTREAM_REPO_ROOT}/stream-servers/apigen-codec-common 137 ${GFXSTREAM_REPO_ROOT}/stream-servers/vulkan) 138target_link_libraries( 139 stream-server-testing-support 140 PUBLIC 141 gfxstream-base 142 gfxstream-host-common 143 OpenGLESDispatch 144 gles1_dec 145 gles2_dec 146 renderControl_dec 147 gfxstream-vulkan-server 148 gfxstream-snapshot 149 apigen-codec-common 150 OSWindow 151 gtest) 152 153# Basic opengl rendering tests################################################## 154add_executable( 155 OpenglRender_unittests 156 tests/FrameBuffer_unittest.cpp 157 tests/DefaultFramebufferBlit_unittest.cpp 158 tests/TextureDraw_unittest.cpp 159 tests/StalePtrRegistry_unittest.cpp) 160target_link_libraries( 161 OpenglRender_unittests 162 PRIVATE 163 stream-server-testing-support 164 gfxstream-base-testing-support 165 gfxstream-host-common-testing-support) 166 167# Snapshot tests################################################################ 168add_executable( 169 OpenglRender_snapshot_unittests 170 tests/GLSnapshotBuffers_unittest.cpp 171 tests/GLSnapshotFramebufferControl_unittest.cpp 172 tests/GLSnapshotFramebuffers_unittest.cpp 173 tests/GLSnapshotMultisampling_unittest.cpp 174 tests/GLSnapshotPixelOperations_unittest.cpp 175 tests/GLSnapshotPixels_unittest.cpp 176 tests/GLSnapshotPrograms_unittest.cpp 177 tests/GLSnapshotRasterization_unittest.cpp 178 tests/GLSnapshotRenderbuffers_unittest.cpp 179 tests/GLSnapshotRendering_unittest.cpp 180 tests/GLSnapshotShaders_unittest.cpp 181 tests/GLSnapshotTextures_unittest.cpp 182 tests/GLSnapshotTransformation_unittest.cpp 183 tests/GLSnapshotVertexAttributes_unittest.cpp 184 tests/GLSnapshot_unittest.cpp) 185target_link_libraries( 186 OpenglRender_snapshot_unittests 187 PRIVATE 188 stream-server-testing-support 189 gfxstream-base-testing-support 190 gfxstream-host-common-testing-support) 191 192# Vulkan tests################################################################## 193add_executable( 194 Vulkan_unittests 195 tests/Vulkan_unittest.cpp) 196target_link_libraries( 197 Vulkan_unittests 198 PRIVATE 199 stream-server-testing-support 200 gfxstream-base-testing-support 201 gfxstream-host-common-testing-support) 202 203add_executable( 204 CompositorVk_unittests 205 tests/CompositorVk_unittest.cpp) 206target_link_libraries( 207 CompositorVk_unittests 208 PRIVATE 209 stream-server-testing-support 210 gfxstream-host-common-testing-support) 211 212add_executable( 213 SwapChainStateVk_unittests 214 tests/SwapChainStateVk_unittest.cpp) 215target_link_libraries( 216 SwapChainStateVk_unittests 217 PRIVATE 218 stream-server-testing-support 219 gfxstream-host-common-testing-support) 220 221add_executable( 222 DisplayVk_unittests 223 tests/DisplayVk_unittest.cpp) 224target_link_libraries( 225 DisplayVk_unittests 226 PRIVATE 227 stream-server-testing-support 228 gfxstream-host-common-testing-support) 229