forked from toyota-connected/ivi-homescreen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
136 lines (110 loc) · 3.85 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
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
#
# Copyright 2020 Toyota Connected North America
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -fno-integrated-as")
set(CMAKE_CXX_FLAGS "-fno-rtti")
string(APPEND CMAKE_EXE_LINKER_FLAGS " -Wl,--no-undefined")
string(APPEND CMAKE_SHARED_LINKER_FLAGS " -Wl,-fvisibility=hidden")
string(APPEND CMAKE_EXE_LINKER_FLAGS " -Wl,--build-id=sha1")
string(APPEND CMAKE_EXE_LINKER_FLAGS " -Wl,--gc-sections")
string(APPEND CMAKE_EXE_LINKER_FLAGS " -Wl,--as-needed")
set(CMAKE_THREAD_PREFER_PTHREAD ON)
include(FindThreads)
include(wayland)
set(SRC_FILES
main.cc
app.cc
display.cc
egl.cc
egl_window.cc
gl_resolver.cc
engine.cc
platform_channel.cc
textures/texture.cc
../third_party/flutter/standard_codec.cc
../third_party/flutter/json_message_codec.cc
../third_party/flutter/json_method_codec.cc
../third_party/flutter/shell/platform/common/text_input_model.cc
${WAYLAND_PROTOCOL_SOURCES}
../third_party/flutter/fml/platform/linux/paths_linux.cc
../third_party/flutter/fml/platform/posix/file_posix.cc
../third_party/flutter/fml/platform/posix/paths_posix.cc
../third_party/flutter/fml/platform/posix/posix_wrappers_posix.cc
../third_party/flutter/fml/platform/posix/shared_mutex_posix.cc
../third_party/flutter/fml/command_line.cc
../third_party/flutter/fml/file.cc
../third_party/flutter/fml/log_settings_state.cc
../third_party/flutter/fml/log_settings.cc
../third_party/flutter/fml/logging.cc
../third_party/flutter/fml/paths.cc
../third_party/flutter/fml/unique_fd.cc
)
add_executable(homescreen ${SRC_FILES})
include(macros)
ENABLE_PLUGIN(isolate)
ENABLE_PLUGIN(platform)
ENABLE_PLUGIN(navigation)
ENABLE_PLUGIN(mouse_cursor)
ENABLE_PLUGIN(package_info)
ENABLE_PLUGIN(opengl_texture)
#ENABLE_PLUGIN(accessibility)
#ENABLE_PLUGIN(connectivity)
#ENABLE_PLUGIN(platform)
#ENABLE_PLUGIN(platform_views)
#ENABLE_PLUGIN(text_input)
#ENABLE_PLUGIN(url_launcher)
# Comment out to disable test texture
ENABLE_TEXTURE(test)
target_compile_definitions(homescreen
PRIVATE
HAVE_STRCHRNUL
EGL_NO_X11
MESA_EGL_NO_X11_HEADERS
HAVE_MEMFD_CREATE
PATH_PREFIX="${CMAKE_INSTALL_PREFIX}"
)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
flutter_engine::flutter_engine
${GLIB2_INCLUDE_DIRS}
../third_party
../third_party/rapidjson/include
)
target_link_libraries(homescreen PRIVATE
${WAYLAND_LIBRARIES}
flutter_engine::flutter_engine
EGL GLESv2
Threads::Threads
dl
)
target_link_directories(homescreen PRIVATE
${CMAKE_BINARY_DIR}
)
target_compile_options(homescreen PUBLIC -flto)
target_link_options(homescreen PUBLIC -flto -v)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_options(homescreen PRIVATE -stdlib=libc++)
target_link_options(homescreen PRIVATE
-fuse-ld=lld
-nodefaultlibs
-stdlib=libc++
-lc++ -lc++abi -lunwind -lc -lm)
endif ()
install(TARGETS homescreen DESTINATION bin)