Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Apple Sillicon (macOS arm64) simulator build #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Frulko
Copy link

@Frulko Frulko commented Aug 17, 2023

Hi,
Following my old issue #2

I tried to get back on my local project to try to make it worked on macOS arm64.
And it was quite easy in fact.

My changes are about :

  • adding a custom make build for macos arm following the Issue building for M1 Mac (arm64) #2
  • adding a way in CMakeLists.txt to detect arm on MacOS and use Simulator instead of build for linux arm.

Now I can build on my MacBook Pro M1.

Thanks for you awesome work
Have a nice day :)

@derekstavis
Copy link
Collaborator

derekstavis commented Aug 21, 2023

Hey, thanks for sending this!

I'm currently using make dev-x86 to compile and run the simulator on my M1 Mac:

$ make dev-x86

...

-- summary of build options:
    Install prefix:  /usr/local
    Target system:   Darwin
    Compiler:
      C compiler:    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc (Clang)
      CFLAGS:         -O0 -Wall -g -ggdb -std=gnu99

...

It's counterintuitive because it does define the platform as x86, but when checking the binary type, it matches arm64:

$ file dev_x86/lvgljs
dev_x86/lvgljs: Mach-O 64-bit executable arm64

I checked this PR and running make dev-macos-arm is giving me an error:

-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error in CMakeLists.txt:
  The CMAKE_C_COMPILER:

    /usr/local/arm/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc

  is not a full path to an existing compiler tool.

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.

-- Configuring incomplete, errors occurred!
make: *** [dev-macos-arm] Error 1

The fact that the first works for me and the second not, and the other way around for you, leads me to believe there may be some environment issue. Here's my toolchain version:

GNU Make 3.81
cmake version 3.27.3
Apple clang version 14.0.3 (clang-1403.0.22.14.1)

Could you share your toolchain version numbers to further investigate?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants