This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree 2 files changed +11
-3
lines changed
2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 1
1
cmake_minimum_required (VERSION 3.15)
2
2
project (FlutterEmbedderGLFW)
3
3
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" )
4
+ set (FLUTTER_ENGINE_VARIANT "host_debug_unopt" CACHE STRING "" )
4
5
5
6
add_executable (flutter_glfw FlutterEmbedderGLFW.cc)
6
7
@@ -21,7 +22,7 @@ include_directories(${CMAKE_SOURCE_DIR}/../../../third_party/glfw/include)
21
22
# This is assuming you've built a local version of the Flutter Engine. If you
22
23
# downloaded yours is from the internet you'll have to change this.
23
24
include_directories (${CMAKE_SOURCE_DIR} /../../shell/platform/embedder)
24
- find_library (FLUTTER_LIB flutter_engine PATHS ${CMAKE_SOURCE_DIR} /../../../out/host_debug_unopt )
25
+ find_library (FLUTTER_LIB flutter_engine PATHS ${CMAKE_SOURCE_DIR} /../../../out/${FLUTTER_ENGINE_VARIANT} )
25
26
target_link_libraries (flutter_glfw ${FLUTTER_LIB} )
26
27
27
28
# Copy the flutter library here since the shared library
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
set -e # Exit if any program returns an error.
3
3
4
+ if uname -m | grep " arm64" ; then
5
+ variant=" host_debug_unopt_arm64"
6
+ else
7
+ variant=" host_debug_unopt"
8
+ fi
9
+
4
10
# ################################################################
5
11
# Make the host C++ project.
6
12
# ################################################################
7
13
if [ ! -d debug ]; then
8
14
mkdir debug
9
15
fi
10
16
cd debug
11
- cmake -DCMAKE_BUILD_TYPE=Debug ..
17
+ cmake -DCMAKE_BUILD_TYPE=Debug -DFLUTTER_ENGINE_VARIANT= $variant ..
12
18
make
13
19
14
20
# ################################################################
17
23
if [ ! -d myapp ]; then
18
24
flutter create myapp
19
25
fi
26
+
20
27
cd myapp
21
28
cp ../../main.dart lib/main.dart
22
29
flutter build bundle \
23
30
--local-engine-src-path ../../../../../ \
24
- --local-engine=host_debug_unopt
31
+ --local-engine=$variant
25
32
cd -
26
33
27
34
# ################################################################
You can’t perform that action at this time.
0 commit comments