-
Notifications
You must be signed in to change notification settings - Fork 128
/
CMakeLists.txt
59 lines (51 loc) · 2.23 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.10)
# We only support clang, so the build will be faild if you try to build with gcc compiler instead of it.
if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
set(CMAKE_C_COMPILER clang)
set(CMAKE_CXX_COMPILER clang++)
endif()
set(CMAKE_CXX_STANDARD 17)
project("flutter_elinux" LANGUAGES CXX C)
# Build options.
set(BACKEND_TYPE "WAYLAND" CACHE STRING "Select WAYLAND, DRM-GBM, DRM-EGLSTREAM, or X11 as the display backend type")
set_property(CACHE BACKEND_TYPE PROPERTY STRINGS "WAYLAND" "DRM-GBM" "DRM-EGLSTREAM" "X11")
# Disabled USE_DIRTY_REGION_MANAGEMENT due flicker issue.
# See https://github.com/sony/flutter-embedded-linux/issues/334
option(USE_DIRTY_REGION_MANAGEMENT "Use Flutter dirty region management" OFF)
option(USE_GLES3 "Use OpenGL ES3 (default is OpenGL ES2)" OFF)
option(ENABLE_EGL_ALPHA_COMPONENT_OF_COLOR_BUFFER "Enable alpha component of the EGL color buffer" ON)
# todo: need to investigate https://github.com/sony/flutter-embedded-linux/pull/376 when enabling this option.
option(ENABLE_VSYNC "Enable embedder vsync" OFF)
option(BUILD_ELINUX_SO "Build .so file of elinux embedder" OFF)
option(ENABLE_ELINUX_EMBEDDER_LOG "Enable logger of eLinux embedder" ON)
option(FLUTTER_RELEASE "Build Flutter Engine with release mode" OFF)
if(NOT BUILD_ELINUX_SO)
# Load the user project.
set(USER_PROJECT_PATH "" CACHE STRING "examples/flutter-wayland-client")
message("User project: ${USER_PROJECT_PATH}")
if(NOT ${BACKEND_TYPE} STREQUAL "WAYLAND")
message(WARNING "BACKEND_TYPE variable is ignored because BUILD_ELINUX_SO is OFF")
endif()
include(${USER_PROJECT_PATH}/cmake/user_config.cmake)
else()
# Set the filename of elinux .so file
if(${BACKEND_TYPE} STREQUAL "DRM-GBM")
set(TARGET_SUFFIX "gbm")
elseif(${BACKEND_TYPE} STREQUAL "DRM-EGLSTREAM")
set(TARGET_SUFFIX "eglstream")
elseif(${BACKEND_TYPE} STREQUAL "X11")
set(TARGET_SUFFIX "x11")
else()
set(TARGET_SUFFIX "wayland")
endif()
set(TARGET "flutter_elinux_${TARGET_SUFFIX}")
endif()
# System level dependent library.
include(cmake/package.cmake)
# Rules of 3rd party libraries.
# RapidJson library.
include(cmake/rapidjson.cmake)
# Build for target.
include(cmake/build.cmake)
# Install the bundle.
include(cmake/install.cmake)