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

Update README with Instruction how to build for macos #91

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mixrich
Copy link

@mixrich mixrich commented Jul 6, 2023

I'm not a C++ developer so not sure is Xcode required but this steps from ci-build.yml work for me.

@a-hurst
Copy link
Contributor

a-hurst commented Jul 9, 2023

Good idea for an addition! I've had to resort to ci-build.yml for build instructions more than a few times. A few notes:

  • You shouldn't need to run any of the cmake or build commands as sudo (if you do, there's probably an issue with your permissions or where you saved the file).
  • Editing LSMinimumSystemVersion to match the version of the compiling system isn't necessary for a working app (I've built from source on macOS 10.14 and 13.3 without doing this)
  • Is the cpack step only required to build a .dmg? When I've built from source the .app bundle gets generated without that command. Since it's not necessary for a working binary you may want to put that as an optional step instead.
  • To build on older versions of macOS (and potentially any non-ARM64 Mac), you need to edit the CMakeLists.txt file so it doesn't try to build for arm64. It would only build on my 2013 iMac with Mojave once the ;arm64 was removed from this bit here:
    if (APPLE)
    if(IOS)
    set(CMAKE_OSX_DEPLOYMENT_TARGET "11" CACHE STRING "")
    set(CMAKE_OSX_ARCHITECTURES "arm64" CACHE STRING "")
    else()
    set(CMAKE_OSX_DEPLOYMENT_TARGET "10.11" CACHE STRING "")
    set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE STRING "")
    endif()
    endif()

Hope this makes it in!

@mixrich
Copy link
Author

mixrich commented Jul 9, 2023

You shouldn't need to run any of the cmake or build commands as sudo

Without sudo compilers were unavailable. Not sure why, but in my case it was so.

Editing LSMinimumSystemVersion to match the version of the compiling system isn't necessary

I was at 13.3.1 with latest Xcode and it complained that 10.11 was too low because 10.12-13.3.1 range was supported. Having 10.11 might be an issue for further macOS versions

@mixrich
Copy link
Author

mixrich commented Jul 10, 2023

you shouldn't need to run any of the cmake or build commands as sudo

you are right, we don't need it I might needed to reboot or reload terminal after I had installed Xcode. It could't find any C/CXX compiler identifications, so I used sudo.

Editing LSMinimumSystemVersion

Since I don't have any issues with 10.11 I remove it from readme

Is the cpack step only required to build a .dmg?

Right. I didn't notice .app in path name in VS Code, so I didn't realise that I already had the App. Removed

To build on older versions of macOS

It could be done by passing -D CMAKE_OSX_ARCHITECTURES=x86_64 or -D CMAKE_OSX_ARCHITECTURES=arm64 which overrides default value x86_64;arm64. Added to readme

@alexbatalov does it worth to add a Makefile on top of cmake to run configure and build in easier way? Such makefile could also be used by CI and Release runners

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.

2 participants