@@ -18,42 +18,29 @@ set(CMAKE_INCLUDE_CURRENT_DIRS ON)
18
18
19
19
find_package (Qt6 6.6 NO_MODULE REQUIRED COMPONENTS Widgets OpenGL )
20
20
21
- if (NOT DEFINED ENV{FLUTTER_ENGINE_FOLDER} )
22
- message (FATAL_ERROR "Point env var FLUTTER_ENGINE_FOLDER to engine folder" )
23
- endif ()
24
-
25
21
if (MSVC )
22
+ # Windows is not tested, this probably doesn't work
26
23
set (FLUTTER_ENGINE_LIBRARY flutter_engine.lib )
27
24
else ()
28
- if (EXISTS "$ENV{FLUTTER_ENGINE_FOLDER} /rel/" )
29
- if (QT_EMBEDDER_AOT )
30
- set (FLUTTER_ENGINE_LIBRARY
31
- rel/libflutter_engine.${CMAKE_SHARED_LIBRARY_SUFFIX} )
32
- else ()
33
- set (FLUTTER_ENGINE_LIBRARY
34
- dbg_unopt/libflutter_engine.${CMAKE_SHARED_LIBRARY_SUFFIX} )
35
- endif ()
36
- set (FLUTTER_ENGINE_INCLUDE_DIR $ENV{FLUTTER_ENGINE_FOLDER} )
25
+ if (QT_EMBEDDER_AOT )
26
+ set (FLUTTER_ENGINE_LIBRARY
27
+ ${CMAKE_SOURCE_DIR} /engine_binaries/rel/libflutter_engine${CMAKE_SHARED_LIBRARY_SUFFIX}
28
+ )
37
29
else ()
38
- if (APPLE )
39
- set (BUILD_FOLDER_NAME host_debug_unopt_arm64 )
40
- else ()
41
- set (BUILD_FOLDER_NAME host_debug_unopt )
42
- endif ()
43
-
44
30
set (FLUTTER_ENGINE_LIBRARY
45
- ../out/${BUILD_FOLDER_NAME} /libflutter_engine${CMAKE_SHARED_LIBRARY_SUFFIX}
31
+ ${CMAKE_SOURCE_DIR} /engine_binaries/dbg_unopt /libflutter_engine${CMAKE_SHARED_LIBRARY_SUFFIX}
46
32
)
47
- set (FLUTTER_ENGINE_INCLUDE_DIR
48
- $ENV{FLUTTER_ENGINE_FOLDER} /../out/${BUILD_FOLDER_NAME} )
49
33
endif ()
50
34
endif ()
51
35
52
- message (
53
- "FLUTTER_ENGINE_LIBRARY=$ENV{FLUTTER_ENGINE_FOLDER} /${FLUTTER_ENGINE_LIBRARY} "
54
- )
36
+ message ("FLUTTER_ENGINE_LIBRARY=${FLUTTER_ENGINE_LIBRARY} }" )
55
37
56
- include_directories (${FLUTTER_ENGINE_INCLUDE_DIR} )
38
+ if (NOT EXISTS ${FLUTTER_ENGINE_LIBRARY} )
39
+ message (
40
+ FATAL_ERROR
41
+ "Could not find ${FLUTTER_ENGINE_LIBRARY} . Did you run dowload_engine.sh ?"
42
+ )
43
+ endif ()
57
44
58
45
if (ENABLE_ASAN )
59
46
add_compile_options (-fsanitize=address -fsanitize=undefined )
@@ -62,31 +49,27 @@ endif()
62
49
63
50
add_library (
64
51
flutter_common_client_wrapper STATIC
65
- $ENV{FLUTTER_ENGINE_FOLDER} /shell/platform/common/client_wrapper/plugin_registrar.cc
66
- $ENV{FLUTTER_ENGINE_FOLDER} /shell/platform/common/client_wrapper/core_implementations.cc
67
- $ENV{FLUTTER_ENGINE_FOLDER} /shell/platform/common/client_wrapper/standard_codec.cc
68
- $ENV{FLUTTER_ENGINE_FOLDER} /shell/platform/common/client_wrapper/engine_method_result.cc
69
- $ENV{FLUTTER_ENGINE_FOLDER} /shell/platform/common/client_wrapper/engine_method_result.cc
70
- $ENV{FLUTTER_ENGINE_FOLDER} /shell/platform/common/incoming_message_dispatcher.cc
71
- )
52
+ 3rdparty/flutter/shell/platform/common/client_wrapper/plugin_registrar.cc
53
+ 3rdparty/flutter/shell/platform/common/client_wrapper/core_implementations.cc
54
+ 3rdparty/flutter/shell/platform/common/client_wrapper/standard_codec.cc
55
+ 3rdparty/flutter/shell/platform/common/client_wrapper/engine_method_result.cc
56
+ 3rdparty/flutter/shell/platform/common/client_wrapper/engine_method_result.cc
57
+ 3rdparty/flutter/shell/platform/common/incoming_message_dispatcher.cc )
72
58
73
59
target_include_directories (
74
60
flutter_common_client_wrapper
75
- PUBLIC
76
- "$ENV{FLUTTER_ENGINE_FOLDER} /shell/platform/common/public"
77
- $ENV{FLUTTER_ENGINE_FOLDER} /shell/platform/embedder/
78
- $ENV{FLUTTER_ENGINE_FOLDER} /shell/platform/common
79
- $ENV{FLUTTER_ENGINE_FOLDER} /shell/platform/common/client_wrapper
80
- $ENV{FLUTTER_ENGINE_FOLDER} /shell/platform/common/client_wrapper/include/
81
- "$ENV{FLUTTER_ENGINE_FOLDER} /.." )
61
+ PUBLIC 3rdparty/flutter/shell/platform/common/public
62
+ 3rdparty/flutter/shell/platform/embedder/
63
+ 3rdparty/flutter/shell/platform/common
64
+ 3rdparty/flutter/shell/platform/common/client_wrapper
65
+ 3rdparty/flutter/shell/platform/common/client_wrapper/include/
66
+ 3rdparty/flutter/.. )
82
67
83
68
add_executable (qtembedder main.cpp src/Embedder.cpp src/FlutterWindow.cpp
84
69
src/3rdparty/flutter/glfw_shell.cpp )
85
70
86
- target_link_libraries (
87
- qtembedder Qt6::Widgets Qt6::OpenGL Qt6::GuiPrivate
88
- $ENV{FLUTTER_ENGINE_FOLDER} /${FLUTTER_ENGINE_LIBRARY}
89
- flutter_common_client_wrapper )
71
+ target_link_libraries (qtembedder Qt6::Widgets Qt6::OpenGL Qt6::GuiPrivate
72
+ ${FLUTTER_ENGINE_LIBRARY} flutter_common_client_wrapper )
90
73
91
74
if (NOT APPLE )
92
75
target_link_libraries (qtembedder EGL )
0 commit comments