AcademySoftwareFoundation / OpenRV

Open source version of RV, the Sci-Tech award-winning media review and playback software.
Other
577 stars 142 forks source link

Support native Apple ARM64 #461

Closed cedrik-fuoco-adsk closed 4 months ago

cedrik-fuoco-adsk commented 4 months ago

Support native Apple ARM64

Linked issues

n/a

Summarize your change.

Supporting both x86_64 and arm64 native build. You can build x86_64 on MacOS if you run the build under a terminal launched with arch -x86_64 (using Rosetta).

I made changes to some dependencies under cmake/dependencies to standardized the configure, command and install command used in externalproject_add since some dependencies were using a mix of CMake and Make command.

Describe the reason for the change.

Support native build of Apple chipset.

Describe what you have tested and on which operating system.

Add a list of changes, and note any that might need special attention during the review.

If possible, provide screenshots.

geffrak commented 4 months ago

I'm not convinced that CMAKE_OSX_ARCHITECTURES is a good solution. Only some third-party dependencies support it (as you can see with Python and OpenSSL). Let's get rid of it and build everything natively. If someone wants to build x86_64 from an Apple Silicon host, that person starts his terminal with arch -x86_64 and builds.

Am I missing something?

cedrik-fuoco-adsk commented 4 months ago

In my mind, there is a difference between cross-compiling and Rosetta since Rosetta is more an emulator/translator than a cross-compiler. For example, when you are building for iOS, you are not using Rosetta, you are using a cross-compiler. So at first, I treated the ARM64 the same way.

So the question is whether we want to support cross-compilation or just native builds. If we want to support cross-compilation, CMAKE_OSX_ARCHITECTURES is the right choice, otherwise it is not needed.

After discussion with @bernie-laberge about your comment @geffrak, we don't really see a use-case to support cross-compilation. So I removed the changed I did about CMAKE_OSX_ARCHITECTURES and we will just support native build.

But like you said, you can still build for x86_64 from arm64 using a terminal launched with arch -x86_64 (using Rosetta).