@@ -124,8 +124,6 @@ add_executable(flutter-pi
124
124
src/platformchannel.c
125
125
src/pluginregistry.c
126
126
src/texture_registry.c
127
- # src/compositor.c
128
- src/gl_renderer.c
129
127
src/modesetting.c
130
128
src/collection.c
131
129
src/cursor.c
@@ -138,15 +136,14 @@ add_executable(flutter-pi
138
136
src/compositor_ng.c
139
137
src/surface.c
140
138
src/render_surface.c
141
- src/egl_gbm_render_surface.c
142
139
src/tracer.c
143
140
src/dmabuf_surface.c
144
141
src/frame_scheduler.c
145
142
src/window.c
146
143
src/plugins/services.c
147
144
)
148
145
149
- target_link_libraries (flutter-pi
146
+ target_link_libraries (flutter-pi PRIVATE
150
147
${DRM_LDFLAGS}
151
148
${GBM_LDFLAGS}
152
149
${EGL_LDFLAGS}
@@ -206,50 +203,51 @@ else()
206
203
target_compile_options (flutter-pi PRIVATE -Wno-missing-field-initializers)
207
204
endif ()
208
205
209
- if (ENABLE_OPENGL)
210
- if (TRY_ENABLE_OPENGL)
211
- pkg_check_modules(EGL egl)
212
- pkg_check_modules(GLESV2 glesv2)
213
- else ()
214
- pkg_check_modules(EGL REQUIRED egl)
215
- pkg_check_modules(GLESV2 REQUIRED glesv2)
216
- endif ()
206
+ pkg_check_modules(EGL egl)
207
+ pkg_check_modules(GLESV2 glesv2)
217
208
218
- if (EGL_FOUND)
219
- target_compile_definitions (flutter-pi PRIVATE HAS_EGL)
220
- target_include_directories (flutter-pi PRIVATE ${EGL_INCLUDE_DIRS} )
221
- target_compile_options (flutter-pi PRIVATE ${EGL_CFLAGS} )
222
- else ()
223
- FetchContent_Declare(
224
- EGL_REGISTRY
225
- GIT_REPOSITORY "https://github.com/KhronosGroup/EGL-Registry"
226
- GIT_TAG "main"
209
+ if (ENABLE_OPENGL)
210
+ if (EGL_FOUND AND GLESV2_FOUND)
211
+ target_sources (flutter-pi PRIVATE
212
+ src/egl_gbm_render_surface.c
213
+ src/gl_renderer.c
227
214
)
228
- FetchContent_MakeAvailable(EGL_REGISTRY)
229
- target_include_directories (flutter-pi PRIVATE ${EGL_REGISTRY_SOURCE_DIR} /api/)
230
- endif ()
231
-
232
- if (GLESV2_FOUND)
233
- target_compile_definitions (flutter-pi PRIVATE HAS_GL)
234
- target_include_directories (flutter-pi PRIVATE ${EGL_INCLUDE_DIRS} )
235
- target_compile_options (flutter-pi PRIVATE ${EGL_CFLAGS} )
236
- else ()
237
- FetchContent_Declare(
238
- OGL_REGISTRY
239
- GIT_REPOSITORY "https://github.com/KhronosGroup/OpenGL-Registry"
240
- GIT_TAG "main"
215
+ target_link_libraries (flutter-pi PRIVATE
216
+ ${EGL_LDFLAGS}
217
+ ${GLESV2_LDFLAGS}
241
218
)
242
- FetchContent_MakeAvailable(OGL_REGISTRY)
243
- target_include_directories (flutter-pi PRIVATE ${OGL_REGISTRY_SOURCE_DIR} /api/)
219
+ target_compile_definitions (flutter-pi PRIVATE HAS_EGL HAS_GL)
220
+ elseif (TRY_ENABLE_OPENGL)
221
+ message ("EGL and/or OpenGL was not found. Flutter-pi will build without EGL/OpenGL rendering support." )
222
+ else ()
223
+ message (SEND_ERROR "EGL and/or OpenGL was not found. Try building with `-DTRY_ENABLE_OPENGL=On` if you want to just disable EGL/OpenGL support in that case." )
244
224
endif ()
225
+ endif ()
245
226
246
- if ( NOT (GLESV2_FOUND AND EGL_FOUND))
247
- if (TRY_ENABLE_OPENGL)
248
- message ("EGL and/or OpenGL was not found. Flutter-pi will build without EGL/OpenGL rendering support." )
249
- else ()
250
- message (SEND_ERROR "EGL and/or OpenGL was not found. Try building with `-DTRY_ENABLE_OPENGL=On` if you want to just disable EGL/OpenGL support in that case." )
251
- endif ()
252
- endif ()
227
+ if (EGL_FOUND)
228
+ target_include_directories (flutter-pi PRIVATE ${EGL_INCLUDE_DIRS} )
229
+ target_compile_options (flutter-pi PRIVATE ${EGL_CFLAGS} )
230
+ else ()
231
+ FetchContent_Declare(
232
+ EGL_REGISTRY
233
+ GIT_REPOSITORY "https://github.com/KhronosGroup/EGL-Registry"
234
+ GIT_TAG "main"
235
+ )
236
+ FetchContent_MakeAvailable(EGL_REGISTRY)
237
+ target_include_directories (flutter-pi PRIVATE ${EGL_REGISTRY_SOURCE_DIR} /api/)
238
+ endif ()
239
+
240
+ if (GLESV2_FOUND)
241
+ target_include_directories (flutter-pi PRIVATE ${GLESV2_INCLUDE_DIRS} )
242
+ target_compile_options (flutter-pi PRIVATE ${GLESV2_CFLAGS} )
243
+ else ()
244
+ FetchContent_Declare(
245
+ OGL_REGISTRY
246
+ GIT_REPOSITORY "https://github.com/KhronosGroup/OpenGL-Registry"
247
+ GIT_TAG "main"
248
+ )
249
+ FetchContent_MakeAvailable(OGL_REGISTRY)
250
+ target_include_directories (flutter-pi PRIVATE ${OGL_REGISTRY_SOURCE_DIR} /api/)
253
251
endif ()
254
252
255
253
if (NOT FILESYSTEM_LAYOUT IN_LIST FILESYSTEM_LAYOUTS)
0 commit comments