summaryrefslogtreecommitdiff
path: root/stream-servers/CMakeLists.txt
blob: 7b3791146852f76c8d48bd5918ae4cf70c22ea9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
# Codec common sources
add_subdirectory(apigen-codec-common)
add_subdirectory(compressedTextureFormats)

# Vulkan
add_subdirectory(vulkan)

# GLES translator
add_subdirectory(glestranslator)
add_subdirectory(libGLSnapshot)

# GLES decoder
add_subdirectory(gles1_dec)
add_subdirectory(gles2_dec)

# GLES dispatch based on Translator
add_subdirectory(OpenGLESDispatch)

# RenderControl decoder
add_subdirectory(renderControl_dec)

# Stream server core
set(stream-server-core-sources
    ChannelStream.cpp
    ColorBuffer.cpp
    CompositorVk.cpp
    DisplayVk.cpp
    FbConfig.cpp
    FenceSync.cpp
    GLESVersionDetector.cpp
    PostWorker.cpp
    ReadbackWorker.cpp
    ReadBuffer.cpp
    render_api.cpp
    RenderChannelImpl.cpp
    RenderThreadInfo.cpp
    RingStream.cpp
    SwapChainStateVk.cpp
    SyncThread.cpp
    TextureDraw.cpp
    TextureResize.cpp
    WindowSurface.cpp
    YUVConverter.cpp
    RenderThread.cpp
    RenderContext.cpp
    RenderControl.cpp
    RenderWindow.cpp
    RenderLibImpl.cpp
    RendererImpl.cpp
    FrameBuffer.cpp)
if (APPLE)
    set(stream-server-core-platform-sources NativeSubWindow_cocoa.m)
elseif (WIN32)
    set(stream-server-core-platform-sources NativeSubWindow_win32.cpp)
else()
    set(stream-server-core-platform-sources NativeSubWindow_x11.cpp)
endif()

add_library(
    gfxstream_backend
    SHARED
    ${stream-server-core-sources}
    ${stream-server-core-platform-sources}
    GfxStreamAgents.cpp
    GfxStreamBackend.cpp
    virtio-gpu-gfxstream-renderer.cpp)
target_link_libraries(
    gfxstream_backend
    PUBLIC
    gfxstream-host-common
    gfxstream-base
    OpenGLESDispatch
    gles1_dec
    gles2_dec
    renderControl_dec
    gfxstream-vulkan-server
    gfxstream-snapshot
    apigen-codec-common
    perfetto-tracing-only)

if (WIN32)
    target_link_libraries(gfxstream_backend PRIVATE D3d9.lib)
    target_link_options(gfxstream_backend PRIVATE /DEBUG)
endif()

target_include_directories(
    gfxstream_backend
    PUBLIC
    ${GFXSTREAM_REPO_ROOT}
    ${GFXSTREAM_REPO_ROOT}/include
    ${GFXSTREAM_REPO_ROOT}/stream-servers
    ${GFXSTREAM_REPO_ROOT}/stream-servers/apigen-codec-common
    ${GFXSTREAM_REPO_ROOT}/stream-servers/vulkan)
android_install_shared(gfxstream_backend)

# Testing libraries
add_subdirectory(testlibs)

# Backend unit tests
add_executable(
    gfxstream_backend_unittests
    gfxstream_unittest.cpp)
target_link_libraries(
    gfxstream_backend_unittests
    PRIVATE
    OSWindow
    gfxstream_backend
    gfxstream-base
    gtest_main)

# More functional tests#########################################################

# Common testing support library################################################
# This includes the server core and testing sources
add_library(
    stream-server-testing-support
    ${stream-server-core-sources}
    ${stream-server-core-platform-sources}
    tests/SampleApplication.cpp
    tests/GLSnapshotTesting.cpp
    tests/OpenGLTestContext.cpp
    tests/GLTestUtils.cpp
    tests/ShaderUtils.cpp
    tests/GLSnapshotTestDispatch.cpp
    tests/GLSnapshotTestStateUtils.cpp
    tests/HelloTriangleImp.cpp)
target_include_directories(
    stream-server-testing-support
    PRIVATE
    ${GFXSTREAM_REPO_ROOT}
    PUBLIC
    ${GFXSTREAM_REPO_ROOT}/base/testing
    ${GFXSTREAM_REPO_ROOT}
    ${GFXSTREAM_REPO_ROOT}/include
    ${GFXSTREAM_REPO_ROOT}/stream-servers
    ${GFXSTREAM_REPO_ROOT}/stream-servers/apigen-codec-common
    ${GFXSTREAM_REPO_ROOT}/stream-servers/vulkan)
target_link_libraries(
    stream-server-testing-support
    PUBLIC
    gfxstream-base
    gfxstream-host-common
    OpenGLESDispatch
    gles1_dec
    gles2_dec
    renderControl_dec
    gfxstream-vulkan-server
    gfxstream-snapshot
    apigen-codec-common
    OSWindow
    gtest)

# Basic opengl rendering tests##################################################
add_executable(
    OpenglRender_unittests
    tests/FrameBuffer_unittest.cpp
    tests/DefaultFramebufferBlit_unittest.cpp
    tests/TextureDraw_unittest.cpp
    tests/StalePtrRegistry_unittest.cpp)
target_link_libraries(
    OpenglRender_unittests
    PRIVATE
    stream-server-testing-support
    gfxstream-base-testing-support
    gfxstream-host-common-testing-support)

# Snapshot tests################################################################
add_executable(
    OpenglRender_snapshot_unittests
    tests/GLSnapshotBuffers_unittest.cpp
    tests/GLSnapshotFramebufferControl_unittest.cpp
    tests/GLSnapshotFramebuffers_unittest.cpp
    tests/GLSnapshotMultisampling_unittest.cpp
    tests/GLSnapshotPixelOperations_unittest.cpp
    tests/GLSnapshotPixels_unittest.cpp
    tests/GLSnapshotPrograms_unittest.cpp
    tests/GLSnapshotRasterization_unittest.cpp
    tests/GLSnapshotRenderbuffers_unittest.cpp
    tests/GLSnapshotRendering_unittest.cpp
    tests/GLSnapshotShaders_unittest.cpp
    tests/GLSnapshotTextures_unittest.cpp
    tests/GLSnapshotTransformation_unittest.cpp
    tests/GLSnapshotVertexAttributes_unittest.cpp
    tests/GLSnapshot_unittest.cpp)
target_link_libraries(
    OpenglRender_snapshot_unittests
    PRIVATE
    stream-server-testing-support
    gfxstream-base-testing-support
    gfxstream-host-common-testing-support)

# Vulkan tests##################################################################
add_executable(
    Vulkan_unittests
    tests/Vulkan_unittest.cpp)
target_link_libraries(
    Vulkan_unittests
    PRIVATE
    stream-server-testing-support
    gfxstream-base-testing-support
    gfxstream-host-common-testing-support)

add_executable(
    CompositorVk_unittests
    tests/CompositorVk_unittest.cpp)
target_link_libraries(
    CompositorVk_unittests
    PRIVATE
    stream-server-testing-support
    gfxstream-host-common-testing-support)

add_executable(
    SwapChainStateVk_unittests
    tests/SwapChainStateVk_unittest.cpp)
target_link_libraries(
    SwapChainStateVk_unittests
    PRIVATE
    stream-server-testing-support
    gfxstream-host-common-testing-support)

add_executable(
    DisplayVk_unittests
    tests/DisplayVk_unittest.cpp)
target_link_libraries(
    DisplayVk_unittests
    PRIVATE
    stream-server-testing-support
    gfxstream-host-common-testing-support)