forked from chinmaygarde/flutter_wayland
-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
93 lines (79 loc) · 2.45 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
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
# Copyright 2018 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
cmake_minimum_required(VERSION 3.9)
project(flutter-launcher-wayland)
find_package(PkgConfig)
find_package(ECM REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
find_package(WaylandScanner REQUIRED)
find_package(WaylandProtocols REQUIRED)
pkg_search_module(XKB xkbcommon REQUIRED)
pkg_search_module(EGL egl REQUIRED)
pkg_search_module(WAYLAND_CLIENT wayland-client REQUIRED)
pkg_search_module(WAYLAND_EGL wayland-egl REQUIRED)
pkg_search_module(GDK gdk-3.0 REQUIRED) # dw: Not used for linking, we just need an access to the header
# If you do not have flutter-engine.pc file
# just provide all FLUTTER_ENGINE* variables using -D
pkg_search_module(FLUTTER_ENGINE flutter-engine)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set (CMAKE_CXX_FLAGS "-Wall -Wextra -Woverloaded-virtual -Wno-unused-parameter ${CMAKE_CXX_FLAGS}")
set(SOURCES
src/main.cc
src/elf.cc
src/keys.cc
src/egl_utils.cc
src/utils.cc
src/debug.cc
src/wayland_display.cc
src/event_loop.cc
src/elf.h
src/macros.h
src/keys.h
src/utils.h
src/egl_utils.h
src/debug.h
src/wayland_display.h
src/event_loop.h
)
ecm_add_wayland_client_protocol(
SOURCES
PROTOCOL "${WaylandProtocols_DATADIR}/stable/presentation-time/presentation-time.xml"
BASENAME "presentation-time"
)
ecm_add_wayland_client_protocol(
SOURCES
PROTOCOL "${WaylandProtocols_DATADIR}/unstable/xwayland-keyboard-grab/xwayland-keyboard-grab-unstable-v1.xml"
BASENAME "xwayland-keyboard-grab"
)
link_directories(
${XKB_LIBRARY_DIRS}
${EGL_LIBRARY_DIRS}
${WAYLAND_CLIENT_LIBRARY_DIRS}
${WAYLAND_EGL_LIBRARY_DIRS}
${FLUTTER_ENGINE_LIBRARY_DIRS}
)
add_executable(flutter-launcher-wayland ${SOURCES})
target_include_directories(flutter-launcher-wayland
PRIVATE
${CMAKE_CURRENT_BINARY_DIR}
${GLFW_INCLUDE_DIRS}
${GLFW_INCLUDE_DIRS}
${XKB_INCLUDE_DIRS}
${EGL_INCLUDE_DIRS}
${WAYLAND_CLIENT_INCLUDE_DIRS}
${WAYLAND_EGL_INCLUDE_DIRS}
${GDK_INCLUDE_DIRS}
${FLUTTER_ENGINE_INCLUDE_DIRS}
)
target_link_libraries(flutter-launcher-wayland
${CMAKE_DL_LIBS}
${XKB_LIBRARIES}
${EGL_LIBRARIES}
${WAYLAND_CLIENT_LIBRARIES}
${WAYLAND_EGL_LIBRARIES}
${FLUTTER_ENGINE_LIBRARIES}
)
install(TARGETS flutter-launcher-wayland DESTINATION bin)