GithubHelp home page GithubHelp logo

Comments (2)

knopp avatar knopp commented on July 4, 2024 1

The biggest issue with this right now is that Flutter engine does not have official arm64 build for macOS. I opened issue for this here but there haven't been much progress. Technically you could build engine yourself from scratch, in which case you can build for arm64 and cross compile for intel (or vice versa) and build the nativeshell app with custom engine (arm64 for arm64 build, intel for intel build) and then lipo the resulting binaries together. I've done it locally, it's doable, but it's quite a lot of work to do.

from nativeshell.

eEQK avatar eEQK commented on July 4, 2024

Building the engine locally is actually easier now compared to last year since Flutter team is actively working on publishing apple silicon engine and also because flutter beta channel already ships arm64 dart.

Just follow these steps: https://github.com/flutter/flutter/wiki/Compiling-the-engine#compiling-for-macos-or-linux

Remember to match kernel binary format version between the engine and flutter, for example for me master channel works with engine's branch flutter-2.12-candidate.11 (you will have to run gclient sync after changing the branch)

  1. Disable unit tests and some skia stuff

root: src/flutter

diff --git a/testing/testing.gni b/testing/testing.gni
index 4fd02403aa..40ca7afb39 100644
--- a/testing/testing.gni
+++ b/testing/testing.gni
@@ -12,7 +12,7 @@ is_aot_test =

 # Unit tests targets are only enabled for host machines and Fuchsia right now
 declare_args() {
-  enable_unittests = current_toolchain == host_toolchain || is_fuchsia
+  enable_unittests = false #current_toolchain == host_toolchain || is_fuchsia
 }

root: src/third_party/skia

diff --git a/BUILD.gn b/BUILD.gn
index d086f04a07..2ab968a942 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -1136,9 +1136,9 @@ optional("raw") {
  public_defines = [ "SK_CODEC_DECODES_RAW" ]

  deps = [
-    "//third_party/dng_sdk",
+#    "//third_party/dng_sdk",
    "//third_party/libjpeg-turbo:libjpeg",
-    "//third_party/piex",
+#    "//third_party/piex",
  ]

  # SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of
  1. There will be an error saying that gen_snapshot is missing, just copy it to the clang directory:
$ cp out/mac_debug_arm64/gen_snapshot out/mac_debug_arm64/clang_x64/gen_snapshot
  1. Run ninja again and it should finish this time.

  2. Then create the link:

$ cd ~/dev/flutter/bin/cache/artifacts/engine
$ ln -s ~/dev/Projects/engine/src/out/mac_debug_arm64 darwin-arm64
  1. Run the app:
$ cargo run

image

from nativeshell.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.