This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 11cmake_minimum_required (VERSION 3.15)
22project (FlutterEmbedderGLFW)
33set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" )
4+ set (FLUTTER_ENGINE_VARIANT "host_debug_unopt" CACHE STRING "" )
45
56add_executable (flutter_glfw FlutterEmbedderGLFW.cc)
67
@@ -21,7 +22,7 @@ include_directories(${CMAKE_SOURCE_DIR}/../../../third_party/glfw/include)
2122# This is assuming you've built a local version of the Flutter Engine. If you
2223# downloaded yours is from the internet you'll have to change this.
2324include_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} )
2526target_link_libraries (flutter_glfw ${FLUTTER_LIB} )
2627
2728# Copy the flutter library here since the shared library
Original file line number Diff line number Diff line change 11#! /bin/bash
22set -e # Exit if any program returns an error.
33
4+ if uname -m | grep " arm64" ; then
5+ variant=" host_debug_unopt_arm64"
6+ else
7+ variant=" host_debug_unopt"
8+ fi
9+
410# ################################################################
511# Make the host C++ project.
612# ################################################################
713if [ ! -d debug ]; then
814 mkdir debug
915fi
1016cd debug
11- cmake -DCMAKE_BUILD_TYPE=Debug ..
17+ cmake -DCMAKE_BUILD_TYPE=Debug -DFLUTTER_ENGINE_VARIANT= $variant ..
1218make
1319
1420# ################################################################
1723if [ ! -d myapp ]; then
1824 flutter create myapp
1925fi
26+
2027cd myapp
2128cp ../../main.dart lib/main.dart
2229flutter build bundle \
2330 --local-engine-src-path ../../../../../ \
24- --local-engine=host_debug_unopt
31+ --local-engine=$variant
2532cd -
2633
2734# ################################################################
You can’t perform that action at this time.
0 commit comments